Schema-qualified statements in pg_dump output

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Schema-qualified statements in pg_dump output
Date: 2008-07-07 13:46:38
Message-ID: FF62236EACF7739BC1C3AEC0@imhotep.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There's a behavior in pg_dump that annoyed me a little bit, the last few
times i had to deal with it:

Consider you have to dump a specific namespace only, you are going to use

pg_dump -n <your_schema> [-t <tables>].

I found it a common use case to restore this dump into a different schema
by simply changing the search_path. With included ownerships this doesn't
work, since pg_dump always outputs the necessary DDL as follows:

ALTER TABLE bernd.foo OWNER TO bernd;

Okay, it isn't too hard to use sed to replace the necessary statements to
use the correct schema, but i think it would be much nicer if pg_dump would
omit the schema-qualified table name here. I'd like to create a patch for
this, if we agree on changing this behavior?

--
Thanks

Bernd

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2008-07-07 13:58:17 Re: [PATCHES] GIN improvements
Previous Message Alvaro Herrera 2008-07-07 13:45:33 Re: [PATCHES] GIN improvements