Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



felix@xxxxxxxxxxx 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 be missing any way to add a constraint to a
> column.

It's there, though you have to look to \h create table to see the
alternatives for "table_constraint".

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux