I'm having difficult to make one script to delete the old constraints from some databases and after, create new ones with new references.
The problem is that the databases are not equal.
eg.: the swpmnh database has the fk_cmp_solicitaca_rh_contrat constraint but the swpmcs database has not. So if I execute the script I would have an error and it won't commit.
I know that Postgres 9.x has the possibility to do DROP CONSTRAINT IF EXISTS, but neither Postgres 8.x nor Oracle 11g have this function.
I'm working and studying SQL about only 3 months, I know that this is a simple thing, but it's being a problem for me.