Re: [GENERAL] Changing constraints to deferrable

2005-03-24 Thread Vivek Khera
On Mar 24, 2005, at 12:42 AM, Greg Stark wrote: 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

Re: [GENERAL] Changing constraints to deferrable

2005-03-23 Thread Greg Stark
Michael Fuhr <[EMAIL PROTECTED]> 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 t

Re: [GENERAL] Changing constraints to deferrable

2005-03-23 Thread Michael Fuhr
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 TABL

Re: [GENERAL] Changing constraints to deferrable

2005-03-23 Thread Greg Stark
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > Greg Stark wrote: > > I want all my foreign key constraints to be deferrable. They were all > > created > > with the default (not deferrable). > > Is it enough to just do update pg_constraint set condeferrable = 't' where > > contype = 'f'; > >

Re: [GENERAL] Changing constraints to deferrable

2005-03-23 Thread Florian G. Pflug
Greg Stark wrote: I want all my foreign key constraints to be deferrable. They were all created with the default (not deferrable). Is it enough to just do update pg_constraint set condeferrable = 't' where contype = 'f'; No - the constraints are actually enforced by triggers - Just just normal

Re: [GENERAL] Changing constraints to deferrable

2005-03-22 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Greg Stark <[EMAIL PROTECTED]> writes: > > Is it enough to just do > > update pg_constraint set condeferrable = 't' where contype = 'f'; > > I think you'd need to start a fresh backend session --- the relcache > entries for the tables probably won't notic

Re: [GENERAL] Changing constraints to deferrable

2005-03-22 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > Is it enough to just do > update pg_constraint set condeferrable = 't' where contype = 'f'; I think you'd need to start a fresh backend session --- the relcache entries for the tables probably won't notice the above hack. regards

[GENERAL] Changing constraints to deferrable

2005-03-22 Thread Greg Stark
I want all my foreign key constraints to be deferrable. They were all created with the default (not deferrable). Is it enough to just do update pg_constraint set condeferrable = 't' where contype = 'f'; ? It doesn't seem to be enough. I still get constraint violations as soon as I try to de