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

Re: Modifying an existing constraint?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Lynna Landstreet <lynna(at)gallery44(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Modifying an existing constraint?
Date: 2004-06-04 23:14:46
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
On Fri, 4 Jun 2004, Lynna Landstreet wrote:

> 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?

You can drop the constraint and add it again with the additional clause
using ALTER TABLE. One warning is that it will recheck the constraint in
this case which may make the ALTER slow if there's alot of data.

In response to


pgsql-novice by date

Next:From: Tom LaneDate: 2004-06-05 04:46:37
Subject: Re: Modifying an existing constraint?
Previous:From: Lynna LandstreetDate: 2004-06-04 23:03:13
Subject: Modifying an existing constraint?

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