Re: pg_dump and alter database

From: <btober(at)seaworthysys(dot)com>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>, <peter_e(at)gmx(dot)net>
Subject: Re: pg_dump and alter database
Date: 2003-08-22 16:56:34
Message-ID: 64808.216.238.112.88.1061571394.squirrel@$HOSTNAME
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> <btober(at)seaworthysys(dot)com> writes:
>> I HAVE used pg_dumpall -g to make a backup of of users and groups,
>> but this output does not include the ALTER DATABASE commands.
>
> No, it looks like pg_dumpall dumps ALTER DATABASE operations for a
> particular database when it dumps that database.
>
>> Does the ALTER DATABASE command get written only when I do an
>> unconditional pg_dumpall, i.e., produce a dump of all databases in
>> the cluster? If that is the case, then I do think the feature ought
>> to be included in pg_dump,
>
> I think there were a couple of arguments for doing it this way. I can
> see a permissions issue for one. pg_dumpall scripts assume they will
> be run by superuser, but pg_dump scripts try to avoid that assumption.
> Also, a pg_dump script doesn't (and shouldn't, IMHO) assume it knows
> the name of the database it's being restored into.
>

I see what you mean about the database name issue, which has the most
impact in my particular case, of course. Would it be possible to do
something like

ALTER DATABASE CURRENT_DATABASE() SET search_path = schema1, schema2;

?

~Berend Tober

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2003-08-22 17:00:57 convert interval info into days
Previous Message Tom Lane 2003-08-22 16:56:01 Re: [HACKERS] Buglist