ALTER TABLE -- how to add ON DELETE CASCADE?

From: felix(at)crowfix(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: ALTER TABLE -- how to add ON DELETE CASCADE?
Date: 2006-03-07 22:06:11
Message-ID: 20060307220611.GA5140@crowfix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 any way to add a constraint to a
column.

Or maybe this isn't a constraint ... does seem like maybe the wrong
name, but I can't think what else it would be called, and the other
choices shown with \h seem even less likely.

Your assiatnce is much appreciated. I would gladly send you some
Oreos or Ginger Nuts :-)

--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix(at)crowfix(dot)com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-03-07 22:36:37 Re: ALTER TABLE -- how to add ON DELETE CASCADE?
Previous Message Emi Lu 2006-03-07 21:28:22 Re: how to setup default privileges