Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 3B6C6475425 for ; Mon, 11 Mar 2002 19:13:29 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 5CD9CD5FA; Mon, 11 Mar 2002 16:13:28 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 525DE5BFD; Mon, 11 Mar 2002 16:13:28 -0800 (PST) Date: Mon, 11 Mar 2002 16:13:28 -0800 (PST) From: Stephan Szabo To: Tim DeMarco Cc: Subject: Re: Renaming tables In-Reply-To: Message-ID: <20020311161232.P53979-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/143 X-Sequence-Number: 3677 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.