Re: Schema-qualified statements in pg_dump output

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Schema-qualified statements in pg_dump output
Date: 2008-07-07 15:09:56
Message-ID: 487231C4.3080707@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bernd Helmle wrote:
> --On Montag, Juli 07, 2008 10:33:35 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> wrote:
>
>> It seems like quite a useless change, since in general there will be
>> other qualified references in the dump that can't safely be removed.
>> IOW what you intend to do doesn't work anyway.
>
> Hmm, If i want to restore just a bunch of tables into a different
> schema, all i need to do is to change the dump's search_path then and
> i don't have to bother with DDL statements having hardwired schema
> qualifications. So this seems a straight forward simplification to me.
>

Why not restore into the original schema name and then rename it? If the
schema already exists you could rename it temporarily and then rename it
back after the restore.

Or, as you originally noted, a simple sed filter on the text dump might
work equally as well.

I don't think in general we need to provide pg_dump with every possible
permutation of uses that can achieved with the construction of simple
tool chains.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-07-07 15:11:33 deadlock_timeout
Previous Message Tom Lane 2008-07-07 15:07:09 Re: Schema-qualified statements in pg_dump output