Troubles from using pg_dumpall with dbname - Mailing list pgsql-hackers

From Hannu Krosing
Subject Troubles from using pg_dumpall with dbname
Date
Msg-id 37D3F7FE.D5A286D9@tm.ee
Whole thread Raw
List pgsql-hackers
This is a warning an a request for change in pg_dumpall behaviour.

One of my co-workers accidentally used pg_dumpall instead of pg_dump
giving it also a dbname argument. According to man pg_dumpall:

  pg_dumpall takes all pg_dump options, but -f and dbname should
  not be used.

the results of using dbname are quite bizarre - namely it dumps
statements for creating all existing databases, but inside them
it puts the contents of the database given by dbname !

As this feature seems to be totally useless, I suggest that
pg_dumpall be modified to produce an error when given dbname
argument instead of silently producing mostly useless db dump.

In our case this went unnoticed until he tried to recreate his
database by doing 'psql dbname <dumpfile', which resulted in
destroying pg_user table and messing up many other databses :(

If this can't be changed, at least the behaviour should be
documented more thoroughly in big red letters.

---------
Hannu

pgsql-hackers by date:

Previous
From: Evan Simpson
Date:
Subject: Re: [HACKERS] DROP TABLE inside transaction block
Next
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] DROP TABLE inside transaction block