BUG #10347: Can't write password to psql or pg_dump

From: derek_ealy(at)rapid7(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #10347: Can't write password to psql or pg_dump
Date: 2014-05-16 20:34:09
Message-ID: 20140516203409.16847.6130@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 10347
Logged by: Derek Ealy
Email address: derek_ealy(at)rapid7(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2014-05-17 04:57:02 Re: BUG #10338: could not read block
Previous Message Tom Lane 2014-05-16 17:25:18 Re: BUG #10334: Function regexp_split_to_array Error with '.' (comma)