Re: ALTER DATABASE vs pg_dump

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER DATABASE vs pg_dump
Date: 2008-06-27 15:34:56
Message-ID: 486508A0.1010007@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Richard Huxton <dev(at)archonet(dot)com> writes:
>> Is it desirable that pg_dump doesn't dump config settings set via ALTER
>> DATABASE?
>
> Well, it's intentional anyway: that's handled by pg_dumpall. The basic
> design is that anything that can be seen from "outside" a specific
> database is handled on the pg_dumpall side.

Well, global settings and per-user settings are clearly global. I'm not
sure that per-database settings are "logically" global, although I'll
accept that's how they're stored.

At present it means you can't reliably do:
DROP DATABASE foo;
pg_restore --create foo.dump
I'd then have to either hand edit the dumpall dump or wade through a
bunch of errors checking that none of them were relevant.

>> I just got bitten by a DateStyle not being restored on my test DB
>
> You could also get bitten by not having restored users or tablespaces
> that the dump depends on, so I'm not sure there's a strong argument
> here for refactoring the responsibility.

Yep, but that will give you a "no such role" error when you try to
restore. This is a situation where you can restore without errors and
end up with different behaviour: dd/mm/yyyy vs mm/dd/yyyy or text-search
stop-words changing.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2008-06-27 15:44:36 Re: VirtualXactLockTableInsert
Previous Message Hiroshi Saito 2008-06-27 15:16:30 Re: MSVC 2003 compile error with pg8.3.3