Re: adding on delete cascade constraint?

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: adding on delete cascade constraint?
Date: 2003-09-19 10:38:00
Message-ID: 1063967879.18550.998.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2003-09-19 at 11:09, Jean-Christian Imbeault wrote:
> Currently I have a table defined as such:
>
> TAL=# \d internal_keywords
> Table "public.internal_keywords"
> Column | Type | Modifiers
> ---------+---------+-----------
> keyword | text | not null
> pid | integer | not null
> Indexes: internal_keywords_pkey primary key btree (keyword, pid)
> Foreign Key constraints: $1 FOREIGN KEY (pid) REFERENCES products(id) ON
> UPDATE NO ACTION ON DELETE NO ACTION
>
> How can I change the ON DELETE action to CASCADE for column pid?
>
> I've check the alter table documentation but cannot find any reference
> to this.

Drop the constraint; then add an amended one.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Bring ye all the tithes into the storehouse, that
there may be meat in mine house, and prove me now
herewith, saith the LORD of hosts, if I will not open
you the windows of heaven, and pour you out a
blessing, that there shall not be room enough to
receive it." Malachi 3:10

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marek Lewczuk 2003-09-19 11:06:21 Zend survey result about dbms...
Previous Message Jean-Christian Imbeault 2003-09-19 10:09:33 adding on delete cascade constraint?