Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJxA-0001OL-Ky for pgsql-general@arkaria.postgresql.org; Fri, 21 Jun 2019 13:51:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heJx9-0006Uy-Fv for pgsql-general@arkaria.postgresql.org; Fri, 21 Jun 2019 13:51:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJx8-0006UK-2c for pgsql-general@lists.postgresql.org; Fri, 21 Jun 2019 13:51:43 +0000 Received: from [64.147.123.19] (helo=wout3-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJx3-0003fL-TH for pgsql-general@lists.postgresql.org; Fri, 21 Jun 2019 13:51:40 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5572C30D; Fri, 21 Jun 2019 09:51:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 21 Jun 2019 09:51:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=i kz8jgC5LcrRwGFRtiDRdGJ6GGcRUfVvVvUyUUV97U4=; b=Y6W1oBx0FHpwK3FZE 7T0fWY0MH0/kk9A15f9uJqSiphLYtt9iuan2oldlhJCuiwW4mn99pXuzPQOnKhhB KoH15MnrnJAJsiwVEMK0m59XQqTGt4jueKYdAt13vMzROJSEnnOtCG9oOHcwMkq8 FD02/oInQ3fQRc1s5s9REZyfrPDmUgx28TpzBNelxgu6q8nPo7eBWLFDuxOY9Ttq S+3fP2e1LzaInyAAWthJSS+1tjS5SlGOIOZymApn4zv267eHdIwl62g1ErtEcOsb zjivEHoWqGheVDEuvj8VcIL0mfvIefcHTcvDme2asG5KCGCLYBug/C6fT17dk/78 mGwXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=ikz8jgC5LcrRwGFRtiDRdGJ6GGcRUfVvVvUyUUV97 U4=; b=io0nuh3T7muVK2frImtpHRRtWuc/L4Eyq4K1qiru1zzxsZAbzjx1eIbqv 9J1lO2GktcgHj9uNoGXJOOlu3pjUDzn6gnlAHSWNkjhFQa65xoJtFrpQFe8inKWa 8qUQUSg8BVDKtQ6QaCexMmKRRlYvRDFrLOXAGf9TK/OXOt0vIrZaL96aTuOJx9C2 BKEeMk1MCRsi99THTZNa+mMiLryKgf6gfj8bE5f63ovqwifpc3zmLAhFE5+o719K Vfgcd4YNAcmMI4o9D527DAaMpE9HuF0b7Ui7io4Am6dOUovjPHXNNUli/k8hqSaa vRX976BkWdJWkUNyA2l16frE5fshw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeigdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddvuddv rdduhedtrddvtddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AA4E80061; Fri, 21 Jun 2019 09:51:15 -0400 (EDT) Subject: Re: Why does the pg_dumpall command have a database option? To: Espresso Beanies Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Fri, 21 Jun 2019 06:51:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.19 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/21/19 6:32 AM, Espresso Beanies wrote: > Will it still dump all of the databases or just the one it connects to? It will dump all the databases. It is just that pg_dumpall is a client to the server and therefore needs to connect to a database within the cluster to do it's work. That is true of all the programs listed here: https://www.postgresql.org/docs/11/reference-client.html Programs that do not have to connect can be found here: https://www.postgresql.org/docs/11/reference-server.html > > On Thu, Jun 20, 2019 at 4:13 PM Adrian Klaver > wrote: > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com