Re: pg_dump does not include database-level user-defined GUC variables?

From: Abelard Hoffman <abelardhoffman(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump does not include database-level user-defined GUC variables?
Date: 2014-09-17 03:14:44
Message-ID: CACEJHMgt0rKaoGu-iz6BnhK-w778+MQLtcHpQz4xeEoGh-xJHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 16, 2014 at 12:39 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 09/16/2014 10:33 AM, Michael Paquier wrote:
>
>> On Tue, Sep 16, 2014 at 8:43 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> wrote:
>>
>>> 2014-09-16 17:39 GMT+02:00 Kevin Grittner <kgrittn(at)ymail(dot)com>:
>>>
>>>> Abelard Hoffman <abelardhoffman(at)gmail(dot)com> wrote:
>>>>
>>>>> I have a user-defined GUC variable that was set at the db level. e.g.,
>>>>>
>>>>> ALTER DATABASE mydb SET myapp.user_id TO '1'
>>>>>
>>>>> Works fine. When I do a pg_dump, however, that variable isn't included.
>>>>> Is that expected? It's not really an attribute of the database?
>>>>>
>>>>
>>>> That sort of information *about the database* is stored at the
>>>> cluster level, not in the database itself. Take a look at
>>>> pg_dumpall.
>>>>
>>> [snip]

>
> If I am looking to recreate a database I am not getting the same one. At
> the least it should be accessible via pg_dumpall -g so you could do
> individual database dumps and get the database guc without having to dump
> the entire cluster.

Yes, that's exactly what bit me. I was trying to figure out why a restore
of a db was failing all tests, and discovered the missing GUCs in the dump.
There may be reasons for it living at the cluster level, but I suspect most
users will expect pg_dump to include them.

AH

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-09-17 03:53:15 Re: Postgresql out of memory during big transaction
Previous Message Craig Ringer 2014-09-17 02:39:08 Re: Need guidance to startup