Restore a backup into a new schema

Поиск
Список
Период
Сортировка
Искать

Restore a backup into a new schema

От:
timalou2@netcourrier.com
Дата:
Hi,

Is it possible to restore a backup schema to another schema ?

For instance I create a backup of a database called "source" with its public schema with pg_backup

I want to restore this backup in a database called "dest" into a new schema called public2 

Thanks a lot for your reply,

Thierry

Re: Restore a backup into a new schema

От:
"Scott Marlowe" <scott.marlowe@gmail.com>
Дата:
On Fri, Jun 13, 2008 at 3:33 AM,   wrote:
> Hi,
>
> Is it possible to restore a backup schema to another schema ?
>
> For instance I create a backup of a database called "source" with its public schema with pg_backup
>
> I want to restore this backup in a database called "dest" into a new schema called public2

Easiest way is to edit the pg_dump file by hand or use sed / awk to
change it on the fly.

If there's a lot of data and that makes it tough to do that, look into
dumping the schema and data separately, but this doesn't always work
quite right for some complex schemas.
FAQ