Matthew Stickney writes:
> The attached is a patch that uses the _fileno/_get_osfhandle approach.
> This doesn't address the stdin fallback, or error handling if opening
> termin fails; however, it should be no worse than what's there now, and
> it fixes the immediate problem.
LGTM; pushed wit
The attached is a patch that uses the _fileno/_get_osfhandle approach.
This doesn't address the stdin fallback, or error handling if opening
termin fails; however, it should be no worse than what's there now, and
it fixes the immediate problem.
I'm still thinking about the fallback in terms of
On Tue, May 22, 2018 at 6:14 PM, Tom Lane wrote:
> Well, the question that ought to be answered first is whether to do
> anything at all, beyond not-crashing. It doesn't seem to me that
> refusing to accept a password if we can't disable echo is a net win,
> so I'm inclined to think it's okay to
Matthew Stickney writes:
> On Tue, May 22, 2018 at 4:09 PM, Tom Lane wrote:
>> But perhaps it's worth adding logic to deal with failure of the call?
> I think it would be sufficient to check whether the SetConsoleMode
> call fails, because that can fail even on a valid handle (e.g. if you
> don'
On Tue, May 22, 2018 at 4:09 PM, Tom Lane wrote:
> [ please don't top-post ]
Sorry, I'm used to using a better mail client than this.
> Hm. The failure mode I was thinking about was insufficient resources
> to allocate another handle
You have a point here; CreateFile does create a new handle (
[ please don't top-post ]
Matthew Stickney writes:
> On Tue, May 22, 2018 at 2:55 PM, Tom Lane wrote:
>> Is it possible to operate on "termin" instead of doing a second open
>> (which might fail, which we are failing to cope with :-()?
> It is possible, at the cost of two extra function calls,
It is possible, at the cost of two extra function calls, which could
theoretically fail (and require a little extra munging to work on
Windows CE -- is that a target platform for postgres?).
Similar to using CreateFile, I think the cases in which those calls
could fail are so extraordinary that ps
Matthew Stickney writes:
> On windows, if you pipe data to psql, the password prompt correctly
> reads from and writes to the console, but the password text is echoed to
> the console. This is because echoing is disabled on the handle for
> stdin, but as part of a pipeline stdin doesn't refer t
This is my first time submitting a patch here; apologies in advance if I
flub the process.
On windows, if you pipe data to psql, the password prompt correctly
reads from and writes to the console, but the password text is echoed to
the console. This is because echoing is disabled on the handle