Re: move table between schemas

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Frank Bax" <fbax(at)sympatico(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: move table between schemas
Date: 2008-12-03 02:13:06
Message-ID: 264855a00812021813jdd32d12w8b75f5927f686b54@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Dec 2, 2008 at 8:55 PM, Frank Bax <fbax(at)sympatico(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Greg Cocks 2008-12-03 02:22:19 Seeking impressions on "The Postgresql Reference Manual" - Volumes 1, 2 & 3
Previous Message Frank Bax 2008-12-03 01:55:38 move table between schemas