Skip site navigation (1) Skip section navigation (2)

Re: How to copy a schema under another name in same database

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to copy a schema under another name in same database
Date: 2008-07-30 16:51:07
Message-ID: 48909BFB.1000904@sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-novice
Daniel Gour wrote:
> Hello!  I have a PostgreSQL (8.3.3, WinXP + linux) database with 
> multiple schemas.  I would like, on a regular basis, to be able to copy 
> the structure and data of one schema under a new schema, using of course 
> a different name.  What would be the easiest way?



Backup the schema with pg_dump; edit file; change schema name and 
restore?  If schema names do not show up in data; then this might work:

pg_dump ... | sed s:schema1:schema2:g | psql


In response to

pgsql-novice by date

Next:From: Daniel GourDate: 2008-07-30 17:04:42
Subject: Re: How to copy a schema under another name in same database
Previous:From: Obe, ReginaDate: 2008-07-30 13:25:28
Subject: Re: How to copy a schema under another name in same database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group