Re: [GENERAL] How to add "on delete cascade" constraints

2012-04-27 Thread Alexander Farber
Thank you - this has worked perfectly On Fri, Apr 27, 2012 at 10:18 PM, Richard Broersma wrote: > You could, but you don't need to since you can do all of this is one > statement: > > ALTER TABLE public.pref_scores > DROP CONSTRAINT pref_scores_gid_fkey, > ADD CONSTRAINT pref_scores_gid_fkey >  

Re: [GENERAL] How to add "on delete cascade" constraints

2012-04-27 Thread Richard Broersma
On Fri, Apr 27, 2012 at 12:40 PM, Alexander Farber wrote: > So it's not a problem to drop and recreate the FOREIGN KEYs? > > And can I use START TRANSACTION while doing it? You could, but you don't need to since you can do all of this is one statement: ALTER TABLE public.pref_scores DROP CONSTRA

Re: [GENERAL] How to add "on delete cascade" constraints

2012-04-27 Thread Raymond O'Donnell
On 27/04/2012 20:40, Alexander Farber wrote: > So it's not a problem to drop and recreate the FOREIGN KEYs? No, unless you're doing it on a production system, and someone inserts a value that'll doesn't agree with the foreign key while it's gone. Adding the constraint back in may take a while (de

Re: [GENERAL] How to add "on delete cascade" constraints

2012-04-27 Thread Alexander Farber
So it's not a problem to drop and recreate the FOREIGN KEYs? And can I use START TRANSACTION while doing it? On Fri, Apr 27, 2012 at 9:30 PM, Raymond O'Donnell wrote: > On 27/04/2012 19:59, Alexander Farber wrote: >> in 8.4.9 is it please possible to add "on delete cascades" to >> the both forei

Re: [GENERAL] How to add "on delete cascade" constraints

2012-04-27 Thread Raymond O'Donnell
On 27/04/2012 19:59, Alexander Farber wrote: > Hello, > > in 8.4.9 is it please possible to add "on delete cascades" to > the both foreign keys in the following table w/o dropping the table? I think you will have to drop the foreign key and re-create it, but certainly not the table. Ray. -- Ra