Michael Fuhr <mike@fuhr.org> writes:
> On Wed, Mar 23, 2005 at 12:13:33PM -0500, Greg Stark wrote:
> >
> > Consider this a plea for an ALTER TABLE ALTER CONSTRAINT command :)
>
> Shouldn't ALTER TABLE DROP CONSTRAINT followed by ALTER TABLE ADD
> CONSTRAINT work? It does for me in simple tests. It's a little
> more work than a single ALTER TABLE ALTER CONSTRAINT would be, but
> it's less hackish than updating the system catalogs directly. Or
> am I missing something?
But I want to do *all* constraints. If I tried to do that manually for
hundreds of constraints I'm certain to get at least some of them wrong.
It would also take a long time to readd all those constraints. And there's
really no reason to have to recheck a constraint to make it deferrable.
Similarly, there's no reason to have to recheck a constraint to change its
behaviour ON DELETE and ON UPDATE.
There could be some tricky bits around making a deferrable constraint not
deferrable. And disabling a constraint would be nice too, reenabling it would
require rechecking but at least it would eliminate the error-prone manual
process of reentering the definition.
--
greg