Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WlhG3-00016t-GK for pgsql-bugs@arkaria.postgresql.org; Sat, 17 May 2014 16:14:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WlhG2-0006VJ-Ve for pgsql-bugs@arkaria.postgresql.org; Sat, 17 May 2014 16:14:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WlOqS-0005cZ-RD for pgsql-bugs@postgresql.org; Fri, 16 May 2014 20:35:08 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WlOqN-0007g1-4t for pgsql-bugs@postgresql.org; Fri, 16 May 2014 20:35:07 +0000 MIME-Version: 1.0 Subject: BUG #10347: Can't write password to psql or pg_dump To: pgsql-bugs@postgresql.org From: derek_ealy@rapid7.com Date: Fri, 16 May 2014 20:34:09 +0000 Message-ID: <20140516203409.16847.6130@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 10347 Logged by: Derek Ealy Email address: derek_ealy@rapid7.com PostgreSQL version: 9.3.4 Operating system: Windows Description: When exec'ing a command to pg_dump or psql from Java there is no "normal" way to send the password to the psql process. On Linux systems it works as expected because I write the password to the input stream of the process running psql. On Windows systems the psql or pg_dump process always hangs after sending the password to stdin of the process. I've gotten around this problem by setting an environment variable before exec'ing the process. I set OSTYPES=msys. This forces psql to use stdin when reading the password. It's not a documented feature, but I found it in the source code. I think there should be a documented way of telling psql and pg_dump to pull the password from stdin. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs