From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Tim DeMarco <Tim.DeMarco@myrio.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Renaming tables
Date: Mon, 11 Mar 2002 16:13:28 -0800 (PST)
Message-ID: <20020311161232.P53979-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <A015F722AB845E4B8458CBABDFFE634203D29C@mail0.myrio.com>
On Mon, 11 Mar 2002, Tim DeMarco wrote:
> I have several tables I am planning on renaming and ran into a little
> trouble. I know I can fix the problem, but I'm hoping there is an
> easier solution. Here is an example: I rename usergroupstatus to
> usergroupstatusvalues. I did a dump of the this table as well as a
> table that has a Fkey to this table:
>
> The constraints still refer to the original table name
> (usergroupstatus). I know that I can drop and re-create the tables
> and have them refer to the new table, but I'm hoping there is a better
> way. Also, if I need to recreate the tables should I use the
> statements above (generated by pg_dump) and manually modify the
> constraints?
It might be easier to drop the triggers and use alter table to add the
foreign key constraints again.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, Tim.DeMarco@myrio.com
Subject: Re: Renaming tables
In-Reply-To: <20020311161232.P53979-100000@megazone23.bigpanda.com>
References: <A015F722AB845E4B8458CBABDFFE634203D29C@mail0.myrio.com> <20020311161232.P53979-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