During development of a PostgreSQL database, I made foreign keys in every table. The problem is that I forgot to select ON DELETE CASCADE option.
I need to set that options on all tables. It seems I can only drop and recreate every constraint manually.
Does anybody know any shortcuts?
Update the constraints directly in pg_constraint. First get the oid’s you need:
And then update these constraints:
More information can be found in the manual. Please do this work within a transaction and do some tests within the transaction as well. Just to be sure.