pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: derek_ealy@rapid7.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10347: Can't write password to psql or pg_dump
Date: Fri, 16 May 2014 20:34:09 +0000
Message-ID: <20140516203409.16847.6130@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (5+ messages)  latest in thread

Message-ID: <20140516203409.16847.6130@wrigleys.postgresql.org>
Permalink:  ../20140516203409.16847.6130@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140516203409.16847.6130@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: derek_ealy@rapid7.com
  Subject: Re: BUG #10347: Can't write password to psql or pg_dump
  In-Reply-To: <20140516203409.16847.6130@wrigleys.postgresql.org>
  References: <20140516203409.16847.6130@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox