Re: How to add "on delete cascade" constraints

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to add "on delete cascade" constraints
Date: 2012-04-27 20:25:23
Message-ID: CAADeyWjQ+jyyRLzcBh04wkdfY2zHD489+Lfr4aU8MYgc6Y=kxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you - this has worked perfectly

On Fri, Apr 27, 2012 at 10:18 PM, Richard Broersma
<richard(dot)broersma(at)gmail(dot)com> wrote:
> You could, but you don't need to since you can do all of this is one statement:
>
> ALTER TABLE public.pref_scores
> DROP CONSTRAINT pref_scores_gid_fkey,
> ADD CONSTRAINT pref_scores_gid_fkey
>    FOREIGN KEY (gid)
>    REFERENCES pref_games(gid)
>    ON DELETE CASCADE;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message J.V. 2012-04-27 21:22:10 How to update a newly added column with sub selects?
Previous Message Richard Broersma 2012-04-27 20:18:57 Re: How to add "on delete cascade" constraints