pg_restore : change schema

Lists: pgsql-admin
From: "Christophe Dore" <c(dot)dore(at)castsoftware(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: pg_restore : change schema
Date: 2010-04-01 09:29:26
Message-ID: 30B673D7B5844B4394E188D9FFAEF0990160F94B@mx01.corp.castsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi

Imagine I have used pg_dump to backup a given single schema.

Is there any feature in pg_restore (8.4) that would allow to restore this schema in a schema with another name ?

Thanks

--

Christophe Doré


From: Francisco Reyes <lists(at)stringsutils(dot)com>
To: Christophe Dore <c(dot)dore(at)castsoftware(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_restore : change schema
Date: 2010-04-01 15:06:43
Message-ID: cone.1270134403.614462.18171.1000@shelca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Christophe Dore writes:

> Imagine I have used pg_dump to backup a given single schema.
> Is there any feature in pg_restore (8.4) that would allow to restore this
> schema in a schema with another name ?

I think there isn't. If the pg_dump is ASCII and the file is small enough
you could edit it.


From: Francisco Reyes <lists(at)stringsutils(dot)com>
To: Julio Leyva <jcleyva(at)hotmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_restore : change schema
Date: 2010-04-01 20:20:01
Message-ID: cone.1270153201.465631.18171.1000@shelca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Julio Leyva writes:

> What about  alter schema  ?

How would that help?

If I understand correctly, the original poster is trying to do something
like:

Source DB
schema1.table1

And restore it to
schema2.table1


From: "Christophe Dore" <c(dot)dore(at)castsoftware(dot)com>
To: "Francisco Reyes" <lists(at)stringsutils(dot)com>, "Julio Leyva" <jcleyva(at)hotmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_restore : change schema
Date: 2010-04-02 06:03:25
Message-ID: 30B673D7B5844B4394E188D9FFAEF0990160F9E7@mx01.corp.castsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Well, that would work if the schema, when restored, is free. If not, you'd like to set the schema name in which you restore before restoring.

When you use Oracle, you can, using exp/imp, change the schema you restore in by setting properly the program arguments. I understand that this is not possible with postgres, and this would be a nice feature.

Regards

--

Christophe Doré

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Francisco Reyes
Sent: jeudi 1 avril 2010 22:20
To: Julio Leyva
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] pg_restore : change schema

Julio Leyva writes:

> What about  alter schema  ?

How would that help?

If I understand correctly, the original poster is trying to do something
like:

Source DB
schema1.table1

And restore it to
schema2.table1