Re: altering foreign keys

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org, Adam Rich <adam(dot)r(at)sbcglobal(dot)net>
Subject: Re: altering foreign keys
Date: 2008-01-22 19:33:54
Message-ID: 107051.32453.qm@web31815.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- On Tue, 1/22/08, Adam Rich <adam(dot)r(at)sbcglobal(dot)net> wrote:

> Is there a way to alter the
> existing keys? (it didn't jump out at me in the manual)

ALTER TABLE your_table
DROP CONSTRAINT your_column_fkey_constraint,
ADD CONSTRAINT your_column_fkey_constraint
FOREIGN KEY your_column
REFERENCES parent_table( primary_column )
ON UPDATE CASCADE;

Regards,
Richard Broersma Jr.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2008-01-22 20:26:44 Re: altering foreign keys
Previous Message Erik Jones 2008-01-22 19:27:23 Re: altering foreign keys