Re: moving database objects from one schema to other - Mailing list pgsql-general

From Thom Brown
Subject Re: moving database objects from one schema to other
Date
Msg-id AANLkTinN7x6JGUA0yv6O4vdMm0BWOahW0mOLFYRvJDz4@mail.gmail.com
Whole thread Raw
In response to moving database objects from one schema to other  (akp geek <akpgeek@gmail.com>)
List pgsql-general
On 28 October 2010 17:11, akp geek <akpgeek@gmail.com> wrote:
> Hi all -
>               I would like to know if there is any other way of moving
> objects from one schema to other schema? right now the way I am doing it is
> , take the backup and importing whatever the database objects I wanted to
> move, I am doing that using pg_restore. But I am finding it difficult for
> functions, sequences
> Thanks for your help
> Regards

Yes, you just need to assign a new schema:

ALTER TABLE table_name SET SCHEMA new_schema;
ALTER FUCNTION function_name SET SCHEMA new_schema;

etc...

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

pgsql-general by date:

Previous
From: akp geek
Date:
Subject: moving database objects from one schema to other
Next
From: Pavel Stehule
Date:
Subject: Re: moving database objects from one schema to other