SW/ControlSW/Database/index

Depot

echo “SELECT shot_no FROM shots”|psql -qAt -U golem golem_database echo “INSERT INTO shots_new (shot_no, timestamp, pre_comment) VALUES (35566, NOW(), ‘testing’);” | psql -U golem golem_database

  • Multiappearence:

echo “SELECT start_shot_no,COUNT(start_shot_no) FROM sessions GROUP BY start_shot_no HAVING COUNT(start_shot_no )> 1”|psql -qAt -U golem golem_database … and delete it for i in echo "SELECT start_shot_no FROM sessions GROUP BY start_shot_no HAVING COUNT(start_shot_no )> 1"|psql -qAt -U golem golem_database; do echo \(i;echo "DELETE FROM sessions WHERE start_shot_no=\)i"|psql -qAt -U golem golem_database;done

http://192.168.2.116/phppgadmin/

Troubles

In order for there to be an “action” there must be a unique colum in the table, e.g. cust_id. Otherwise, there is no way to determine which row to delete in an action query that could be generated. So, either add a unique column or designate one of the columns as unique. You need to add a UNIQUE or PRIMARY KEY constraint on the table.