Closed mkuiack closed 7 years ago
I've tried manually
(trapvenv)mkuiack@struis:/scratch/mkuiack
$ psql -h vlo.science.uva.nl -U mkuiack -c "DELETE FROM varmetric WHERE id=2205;" nobeam_16SB
Password for user mkuiack:
DELETE 0
then
(trapvenv)mkuiack@struis:/scratch/mkuiack
$ psql -h vlo.science.uva.nl -U mkuiack -c "DELETE FROM runningcatalog WHERE inactive= TRUE;" nobeam_16SB
Password for user mkuiack:
ERROR: update or delete on table "runningcatalog" violates foreign key constraint "varmetric_runcat_fkey" on table "varmetric"
DETAIL: Key (id)=(2205) is still referenced from table "varmetric".
you cant delete runcat entries that are referenced by other objects in your database. This is a feature, you don't want objects with dangling references. Depending on what you want to do, you can manually remove the entries in the varmetric tables that are referencing to the runcat entries you want to do delete.
or, if you are lazy, you can do a cascaded delete, google SQL delete casacade. I'm not sure how to do that also. But be careful if you do such a thing not carefully you may end up with an empty database.
Not sure what caused this bug but the solution was:
$ psql -h vlo.science.uva.nl -U mkuiack -c "DELETE FROM varmetric WHERE runcat = 2205;" nobeam_16SB
Password for user mkuiack:
DELETE 1
(trapvenv)mkuiack@struis:/scratch/mkuiack
$ psql -h vlo.science.uva.nl -U mkuiack -c "DELETE FROM runningcatalog WHERE inactive= TRUE;" nobeam_16SB
Password for user mkuiack:
DELETE 1
Trap is now running thought the images again.
this iissue has been resolved right @mkuiack ? if so, please close this issue.
While processing a batch of images TraP failed when there was an attempt to delete inactive entries from the runningcatalog table. One of the entires was still referenced in the varmetric table. This causes an issue with "foreign key constraints" and I don't know enough (any) SQL to figure out what's going on. The database is now completely locked up so that I cannot just rerun the batch of images with a new dataset.
from the trap.log: