Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WwgPB-0005Ul-9K for pgsql-admin@arkaria.postgresql.org; Mon, 16 Jun 2014 23:33:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WwgPA-0007ET-Ol for pgsql-admin@arkaria.postgresql.org; Mon, 16 Jun 2014 23:33:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WwgP8-0007BR-Rf for pgsql-admin@postgresql.org; Mon, 16 Jun 2014 23:33:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WwgP6-0002JB-2Z for pgsql-admin@postgresql.org; Mon, 16 Jun 2014 23:33:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s5GNXUGR025614; Mon, 16 Jun 2014 19:33:30 -0400 From: Tom Lane To: hubert depesz lubaczewski cc: John Scalia , pgsql-admin@postgresql.org Subject: Re: Using psql, pg_dump, pg_restore in a script In-reply-to: References: <539F3D20.1060001@gmail.com> Comments: In-reply-to hubert depesz lubaczewski message dated "Mon, 16 Jun 2014 21:49:05 +0200" Date: Mon, 16 Jun 2014 19:33:30 -0400 Message-ID: <25613.1402961610@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org hubert depesz lubaczewski writes: > Giving password as command line option would show it to everybody. Exactly. > On the other hand - plaintext file should have privileges set so that > noone, except for owner of the account from which you're running > psql/pg_dump/pg_restore, can read it. > If you prefer, you can set PGPASSWORD environment variable - it will also > be used by all 3 of these programs (and most other). Note that environment variables are also unsafe on some platforms, though (I think) not all. The .pgpass solution is actually quite the safest one. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin