Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Aram Fingal
On Nov 17, 2010, at 12:42 PM, Richard Broersma wrote: > ALTER TABLE foo > DROP CONSTRAINT your_constraint, > ADD CONSTRAINT your_constraint FOREIGN KEY ... > ON UPDATE CASCADE ON DELETE RESTRICT; Thanks. That worked. -Aram -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Andreas Kretschmer
Richard Broersma wrote: > On Wed, Nov 17, 2010 at 8:43 AM, David Fetter wrote: > > > You can do it like this: > > > > BEGIN; > > ALTER TABLE foo DROP CONSTRAINT your_constraint; > > ALTER TABLE foo ADD FOREIGN KEY ...; > > COMMIT; > > The nice thing about the ALTER TABLE statement is that you

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Richard Broersma
On Wed, Nov 17, 2010 at 8:43 AM, David Fetter wrote: > You can do it like this: > > BEGIN; > ALTER TABLE foo DROP CONSTRAINT your_constraint; > ALTER TABLE foo ADD FOREIGN KEY ...; > COMMIT; The nice thing about the ALTER TABLE statement is that you can do it in one command: ALTER TABLE foo DR

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread David Fetter
On Wed, Nov 17, 2010 at 11:32:32AM -0500, Aram Fingal wrote: > I have a table where I should have declared a foreign key with ON > UPDATE CASCADE and didn't. Now I want to fix that. From the > documentation on www.postgresql.org, about ALTER TABLE it's not at > all clear how to do this or even wh

Re: [GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Adrian Klaver
On 11/17/2010 08:32 AM, Aram Fingal wrote: I have a table where I should have declared a foreign key with ON UPDATE CASCADE and didn't. Now I want to fix that. From the documentation on www.postgresql.org, about ALTER TABLE it's not at all clear how to do this or even whether you can do this

[GENERAL] Alter table to "on update cascade"

2010-11-17 Thread Aram Fingal
I have a table where I should have declared a foreign key with ON UPDATE CASCADE and didn't. Now I want to fix that. From the documentation on www.postgresql.org, about ALTER TABLE it's not at all clear how to do this or even whether you can do this. -Aram -- Sent via pgsql-general mailing