Re: Why does the pg_dumpall command have a database option? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Why does the pg_dumpall command have a database option?
Date
Msg-id d2d0b615-7e9b-afbb-5892-33aa12167e1b@aklaver.com
Whole thread Raw
In response to Why does the pg_dumpall command have a database option?  (Espresso Beanies <espressobeanies@gmail.com>)
Responses Re: Why does the pg_dumpall command have a database option?
List pgsql-general
On 6/20/19 1:03 PM, Espresso Beanies wrote:
> I'm trying to see if someone could answer to me why the pg_dumpall 
> command has a database option when it's designed to dump all the 
> databases in a PostgreSQL server instance. I'm only asking because when 
> I create a .pgpass file and try to use the pg_dumpall command, I'm still 
> required to specify a specific database even though the command itself 
> should be targeting all databases. Can anyone explain this to me a bit 
> better?
> 
> Thanks,

Because pg_dumpall is a client and needs to connect to a database to 
kick start the process/fetch global information:

https://www.postgresql.org/docs/11/app-pg-dumpall.html

-l dbname
--database=dbname

     Specifies the name of the database to connect to for dumping global 
objects and discovering what other databases should be dumped. If not 
specified, the postgres database will be used, and if that does not 
exist, template1 will be used.


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Espresso Beanies
Date:
Subject: Why does the pg_dumpall command have a database option?
Next
From: Harry Ambrose
Date:
Subject: Odd Update Behaviour