Re: pg_dump and alter database - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_dump and alter database
Date
Msg-id 16269.1061570255@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump and alter database  (<btober@seaworthysys.com>)
Responses Re: pg_dump and alter database  (<btober@seaworthysys.com>)
Re: pg_dump and alter database  (Peter Eisentraut <peter_e@gmx.net>)
Re: pg_dump and alter database  (Fernando Schapachnik <fernando@mecon.gov.ar>)
List pgsql-general
<btober@seaworthysys.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.

Peter, do you recall any other issues?

            regards, tom lane

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: Collation rules and multi-lingual databases
Next
From:
Date:
Subject: Re: pg_dump and alter database