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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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