Skip site navigation (1) Skip section navigation (2)

Re: Modifying an existing constraint?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lynna Landstreet <lynna(at)gallery44(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Modifying an existing constraint?
Date: 2004-06-05 04:46:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Lynna Landstreet <lynna(at)gallery44(dot)org> writes:
> Does anyone know if it's possible to modify an existing table constraint -
> for example, to add "ON DELETE CASCADE" to an existing foreign key
> constraint? Or would I have to recreate the table to add that?

There's no command to modify a foreign key constraint like that, but you
should be able to drop and re-add that single constraint using ALTER TABLE.
I don't see a reason to recreate the whole table...

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Lynna LandstreetDate: 2004-06-05 17:35:35
Subject: Re: ON DELETE CASCADE (was: Modifying an existing
Previous:From: Stephan SzaboDate: 2004-06-04 23:14:46
Subject: Re: Modifying an existing constraint?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group