Re: viewing/altering the "ON DELETE CASCADE" constraint

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jon Lapham <lapham(at)extracta(dot)com(dot)br>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: viewing/altering the "ON DELETE CASCADE" constraint
Date: 2002-07-22 17:32:08
Message-ID: 20020722103016.L14333-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 22 Jul 2002, Jon Lapham wrote:

> Hello All-
>
> I'm sure this is a FAQ, but I cannot find anything in the docs that
> directly addresses this.
>
> How can I determine if a column 1) has a foreign key constraint, and 2)
> if that fkey constraint includes "ON DELETE CASCADE"? I've tried the
> various "\d"-type commands in psql to no avail.
>
> Finally, assuming you have a column that *has* a fkey constraint, but
> not the additional "ON DELETE CASCADE" portion, how would you go about
> adding "ON DELETE CASCADE" to the column?

The best place to get info on this is at
http://techdocs.postgresql.org/

There are a few things on referential integrity there that I believe
describe how to get the info on the constraints. As for changing
the constraint, you'll probably need to drop the constraint (dropping
the triggers) and then add it with alter table add constraint probably.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message My Deja 2002-07-22 18:47:27 Re: RAD web development with PostgreSQL?
Previous Message Andrew Sullivan 2002-07-22 17:14:00 Re: Windows - why not?