pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Charles Hauser <chauser@acpub.duke.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: ALTER CONSTRAINT FOREIGN KEY
Date: Wed, 13 Mar 2002 08:02:28 -0800 (PST)
Message-ID: <20020313075909.F81426-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <a05010405b8ad914655be@[152.3.11.193]>


On Thu, 7 Mar 2002, Charles Hauser wrote:

> When I created a TABLE clone I initially defined a column:
> gb_accessions_id INTEGER REFERENCES gb_accessions(gb_accessions_id) NULL
>
>
> I have renamed TABLE gb_accessions to TABLE gb, and its column
> gb_accessions_id to gb_id.
>
> I next renamed the column 'gb_accessions_id' in TABLE clone to 'gb_id'.
> In renaming this column in TABLE clone I appear to have lost the
> reference to TABLE gb (see below).
>
> Questions:
>
> 1. During which step in my renaming did this occur?

As soon as you renamed either the table or column the constraint got
broken.

> 2. How should I have carried this out?

Pretty much you need to kill the references constraint that was there.
This involes dropping the triggeres involved in the constraint (see
techdocs.postgresql.org for more details - they've got some writings
that will help)

> 3. Can I add back REFERENCES gb(gb_id)?
Yes, use alter table add constraint to add the constraint back.




view thread (2+ messages)

Message-ID: <20020313075909.F81426-100000@megazone23.bigpanda.com>
Permalink:  ../20020313075909.F81426-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020313075909.F81426-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, chauser@acpub.duke.edu
  Subject: Re: ALTER CONSTRAINT FOREIGN KEY
  In-Reply-To: <20020313075909.F81426-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox