Skip to content

Instantly share code, notes, and snippets.

@aiminy
Created November 14, 2013 18:59
Show Gist options
  • Save aiminy/7472379 to your computer and use it in GitHub Desktop.
Save aiminy/7472379 to your computer and use it in GitHub Desktop.
delete from stock where stock_id in (select stock_id from nd_experiment_stock where nd_experiment_id in (select nd_experiment_id from nd_experiment_project where project_id = 13));
ERROR: update or delete on table "stock" violates foreign key constraint "stock_owner_stock_id_fkey" on table "stock_owner"
DETAIL: Key (stock_id)=(3994) is still referenced from table "stock_owner".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment