Re: Renaming tables to other schemas
Robert Treat <xzilla@users.sourceforge.net>
From: Robert Treat <xzilla@users.sourceforge.net>
To: Rod Taylor <rbt@rbt.ca>, Neil Conway <neilc@samurai.com>
Cc: ziga@ljudmila.org, PostgreSQL Development <pgsql-hackers@postgresql.org>, Bruce Momjian <pgman@candle.pha.pa.us>
Date: 2004-02-20T15:13:00Z
Lists: pgsql-hackers
On Sunday 15 February 2004 07:53, Rod Taylor wrote:
> On Sun, 2004-02-15 at 01:34, Neil Conway wrote:
> > ziga@ljudmila.org writes:
> > > The capability to move objects to other schemas would be quite
> > > useful.
> >
> > I agree. It's not utterly-trivial to implement (for one thing, you
> > need to move any dependant objects like indexes to the new schema),
> > but some form of this functionality would be a useful thing to add,
> > IMHO.
>
> It's not that hard to do either (I've done about 100 tables by hand at
> this point).
>
> Anyway, this should be supported by all RENAME commands, not just ALTER
> TABLE.
Rod, can you lay out some psdueo code / logic involved in the process? I'm
guessing you lock the entry in pg_class, you up dependent objects, lock them,
update them all... is there more to it?
Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL