Re: ALTER TABLE schema SCHEMA TO new_schema? - Mailing list pgsql-hackers

From Fernando Nasser
Subject Re: ALTER TABLE schema SCHEMA TO new_schema?
Date
Msg-id 3DECD9C6.4040106@redhat.com
Whole thread Raw
In response to ALTER TABLE schema SCHEMA TO new_schema?  (Joe Conway <mail@joeconway.com>)
Responses Re: ALTER TABLE schema SCHEMA TO new_schema?
List pgsql-hackers
Rod Taylor wrote:
>>Why just restrict them to moving tables?  What if someone wants to move a
>>function or an aggregate to another schema?
>>
>>What if they want to copy it?
> 
> 
> Copying might be tricky, but I'd be happy to help with moving everything
> else around.  Though I don't think sequences can move (until we can
> properly track their dependencies) but everything else should be able
> to.
> 
> Copy is another story all together.  But I'd like a
> 
> CREATE SCHEMA ... AS COPY <schemaname>;
> 

Wouldn't it be better to use pg_dump/pg_restore for that?

If we could ask for just oen/some of the non-system schemas to be dumped 
it would be easy to restore it as another or even move it to another 
database.  And one could dump only the schema or schema+data, as needed.
Of course, dependencies would have to be handled as objects can refer to 
objects in other schemas.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] 7.3 -> pg_atoi: zero-length string
Next
From: Teodor Sigaev
Date:
Subject: Re: Backend crash with tsearch