Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-08 Thread Jim Nasby
On Mar 7, 2006, at 4:42 PM, [EMAIL PROTECTED] wrote: On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote: [EMAIL PROTECTED] writes: ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE You're missing the specification of the foreign key, not to mention spelling the CASCADE

Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-08 Thread David Fetter
On Wed, Mar 08, 2006 at 04:06:55PM -0600, Jim Nasby wrote: On Mar 7, 2006, at 4:42 PM, [EMAIL PROTECTED] wrote: On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote: [EMAIL PROTECTED] writes: ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE You're missing the specification

[GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread felix
I have table A with a column AA which references table B's primary key BB, and I want to alter column AA to delete on cascade. ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE is what I tried with a zillion variations, all reporting syntax errors. \h alter table seems to be missing

Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread Tom Lane
[EMAIL PROTECTED] writes: ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE You're missing the specification of the foreign key, not to mention spelling the CASCADE clause backwards. Try ALTER TABLE A ADD FOREIGN KEY(AA) REFERENCES B(BB) ON DELETE CASCADE \h alter table seems to

Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread felix
On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote: [EMAIL PROTECTED] writes: ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE You're missing the specification of the foreign key, not to mention spelling the CASCADE clause backwards. Try ALTER TABLE A ADD FOREIGN