Обсуждение: Troubles from using pg_dumpall with dbname

Поиск
Список
Период
Сортировка

Troubles from using pg_dumpall with dbname

От
Hannu Krosing
Дата:
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