Revision de182c178ccc0a9b1232d6ff64034b7551a36336

Handling/SWinfastructure/pSQL/depot

Changes from de182c178ccc0a9b1232d6ff64034b7551a36336 to 671dfae9b29960fba966f379a8f49e47ea1f529b

---
format:markdown
...


~~~
echo "\copy \"PhysQuant\" to '$CSVFILE' DELIMITER ','  CSV HEADER FORCE QUOTE * NULL 'NULL'"| psql -U golem golem_database;sed -i 's/,NULL/,"NULL"/g' $CSVFILE; head $CSVFILE
"\copy (SELECT * FROM \"PhysQuant\" WHERE tag LIKE '%"$i"%') to '$CSVFILE' DELIMITER ','  CSV HEADER FORCE QUOTE * NULL 'NULL'"
~~~

~~~
echo "UPDATE \"PhysQuant\" SET \"Unit\" = REPLACE(\"Unit\",'\\Omega','$\\Omega$')"| psql -U golem golem_database
~~~

~~~
echo "SELECT *  from shots LIMIT 100;"| psql -U golem golem_database
~~~

~~~
source /golem/svoboda/Dirigent/Setups/20_CAAS_HXRdiagnostics.setup #tuning
function pSQLpreparation()
{
    for i in $Probes; do 
        for j in x y z; do
            echo ALTER TABLE shots
            echo ADD COLUMN "$j"_"$i" INTEGER\;
            echo COMMENT on COLUMN shots."$j"_"$i" IS \'$j position of the probe $i [cm]\'\;
        done
        for j in theta phi; do
            echo ALTER TABLE shots
            echo ADD COLUMN "$j"_"$i" INTEGER\;
            echo COMMENT on COLUMN shots."$j"_"$i" IS \'$j direction of the probe $i [grad]\'\;
        done
        for j in Voltage Current; do
            echo ALTER TABLE shots
            echo ADD COLUMN "$j"_"$i" INTEGER\;
            echo COMMENT on COLUMN shots."$j"_"$i" IS \'$j on the probe $i [V\|mA]\'\;
        done
    
        
    done
}
~~~