Re: move table between schemas - Mailing list pgsql-novice

From Sean Davis
Subject Re: move table between schemas
Date
Msg-id 264855a00812021813jdd32d12w8b75f5927f686b54@mail.gmail.com
Whole thread Raw
In response to move table between schemas  (Frank Bax <fbax@sympatico.ca>)
Responses Re: move table between schemas  (Frank Bax <fbax@sympatico.ca>)
List pgsql-novice
On Tue, Dec 2, 2008 at 8:55 PM, Frank Bax <fbax@sympatico.ca> wrote:
>
> Is it possible to move a table from one schema to another (in the same database)?
>
> The only way I can think of is to:
>        - backup table
>        - modify backup file
>        - restore from modified backup
>        - delete original table
>
> Is there a better/easier way?

ALTER TABLE name
    SET SCHEMA new_schema

http://www.postgresql.org/docs/current/static/sql-altertable.html


Hope that helps.

Sean

pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: move table between schemas
Next
From: "Greg Cocks"
Date:
Subject: Seeking impressions on "The Postgresql Reference Manual" - Volumes 1, 2 & 3