pg_restore : change schema

This is a multi-part message in MIME format.

------_=_NextPart_001_01CAD17D.D2B37BF8
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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=E9


------_=_NextPart_001_01CAD17D.D2B37BF8
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7654.12">
<TITLE>pg_restore : change schema</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT =
FACE=3D"Calibri">Hi</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT FACE=3D"Calibri">Imagine I have =
used pg_dump to backup a given single schema.</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT FACE=3D"Calibri">Is there any =
feature in pg_restore (8.4) that would allow to =
restore</FONT></SPAN><SPAN LANG=3D"en-us"><FONT FACE=3D"Calibri"> this =
schema in a schema with another name ?</FONT></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><FONT =
FACE=3D"Calibri">Thanks</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><B></B></SPAN><SPAN =
LANG=3D"en-us"><B></B></SPAN><B><SPAN LANG=3D"fr-fr"><FONT SIZE=3D1 =
FACE=3D"Calibri">--</FONT></SPAN></B><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"fr-fr"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"><B></B></SPAN><SPAN =
LANG=3D"en-us"><B></B></SPAN><B><SPAN LANG=3D"fr-fr"></SPAN></B><B><SPAN =
LANG=3D"fr-fr"><FONT SIZE=3D1 FACE=3D"Arial">Christophe =
Dor=E9</FONT></SPAN></B><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"fr-fr"></SPAN></P>

<P DIR=3DLTR><SPAN LANG=3D"en-us"></SPAN></P>

</BODY>
</HTML>
------_=_NextPart_001_01CAD17D.D2B37BF8--
Christophe Dore [ Do, 01 April 2010 11:29 ] [ ID #2037421 ]

Re: pg_restore : change schema

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.

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Francisco Reyes [ Do, 01 April 2010 17:06 ] [ ID #2037423 ]

Re: pg_restore : change schema

Julio Leyva writes:

> What about=A0 alter schema=A0 ?

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

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Francisco Reyes [ Do, 01 April 2010 22:20 ] [ ID #2037424 ]

Re: pg_restore : change schema

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=E9

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

Julio Leyva writes:

> What about=A0 alter schema=A0 ?

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

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Christophe Dore [ Fr, 02 April 2010 08:03 ] [ ID #2037541 ]
Datenbanken » gmane.comp.db.postgresql.admin » pg_restore : change schema

Vorheriges Thema: Execute VACUUM FULL when DB touches a specific size ?
Nächstes Thema: Live sort-of-'warehousing' database how-to?