Search Postgresql Archives

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

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

 



On Mar 7, 2006, at 4:42 PM, felix@xxxxxxxxxxx wrote:

On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote:
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

Got it right in the Subject: and my many attempts, just not in the
body :-)

The column already had the foreign key, I never thought to add it
again.  I was only thinking of modifying the minimum necessary.

Yeah, unfortunately there's no support for modifying constraints.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@xxxxxxxxxxxxx
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461




[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