Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlKp-00Byp6-1C for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 18:57:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qjlKn-005kBl-Ia for pgsql-general@arkaria.postgresql.org; Fri, 22 Sep 2023 18:57:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlK4-005gHL-3W for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 18:56:16 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qjlK1-0064Rl-7l for pgsql-general@lists.postgresql.org; Fri, 22 Sep 2023 18:56:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38MIuBOa1065799; Fri, 22 Sep 2023 14:56:11 -0400 From: Tom Lane To: "David G. Johnston" cc: Dominique Devienne , Luca Ferrari , "pgsql-general@lists.postgresql.org" Subject: Re: How to fork pg_dump or psql w/o leaking secrets? In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Fri, 22 Sep 2023 11:27:56 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1065797.1695408971.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 22 Sep 2023 14:56:11 -0400 Message-ID: <1065798.1695408971@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > Once you have the password you should utilize the PGPASSWORD environment > variable to get it passed to psql. It doesn’t matter in the least how you > obtained that password in the first place. Keep in mind that on many flavors of Unix, a process's environment variables can readily be inspected by other processes. You should check your platform carefully before assuming that PGPASSWORD is a safe way to pass down a secret. regards, tom lane