pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: pgsql-sql@postgresql.org
Subject: recreating table and foreign keys
Date: Tue, 3 Dec 2002 17:03:24 +0800
Message-ID: <20021203170324.M63387@klaster.net> (raw)

Hi
I use Postgresql 7.2.2.
Sometimes I have to remove a column from my tables (psql):
1. alter table master_table rename to x;
2. \i tables.sql
3. insert into master_table select f1,f2,... from x
4. drop table x

I think, foreign keys referring from detail_table(s) to master_table 
have gone.
How to recreate foreign keys? I want to keep my database in better 
integrity, than now...

Tomasz Myrta







view thread (4+ messages)  latest in thread

Message-ID: <20021203170324.M63387@klaster.net>
Permalink:  ../20021203170324.M63387@klaster.net/
Also on:    postgresql.org/message-id/20021203170324.M63387@klaster.net

 · 

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: jasiek@klaster.net
  Subject: Re: recreating table and foreign keys
  In-Reply-To: <20021203170324.M63387@klaster.net>

* 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