Re: BUG #2000: psql does not prompt for password - Mailing list pgsql-bugs

From Magnus Hagander
Subject Re: BUG #2000: psql does not prompt for password
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE92E9C2@algol.sollentuna.se
Whole thread Raw
In response to BUG #2000: psql does not prompt for password  ("Todd" <tdoolitt@comcast.net>)
Responses Re: BUG #2000: psql does not prompt for password
List pgsql-bugs
Wow, that's really weird :-)

Do you have any pgpass.conf anywhere? Either on the local disk or on the
network drive in question? Please do a search for it.

If not, can you also check if you by any chance have more than one
libpq.dll installed, in different location? And if sho, which versions
these are?

And finally, is this the pginstaller installed version, or something
else?

//Magnus
=20

> -----Original Message-----
> From: pgsql-bugs-owner@postgresql.org=20
> Sent: Thursday, December 22, 2005 7:14 PM
> To: pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #2000: psql does not prompt for password
>=20
> I just installed the 8.1.1 release on Windows XP Pro and=20
> encountered a very strange problem that seems to be related=20
> to your problem.  My pg_hba.conf is the default=20
> out-of-the-box config (i.e local IPv4 connections are=20
> configured as: host all all 127.0.0.1/32 md5).  I tried=20
> running psql from different shells, cmd.exe and 4NT, as well=20
> as using the shortcut to cmd.exe installed by the PostgreSQL=20
> installer.  In some cases I was prompted for a password, but=20
> in other cases, psql would not prompt me, even if I tried to=20
> force it with -W.
> After several hours of testing different login users and=20
> pg_hba.conf entries I stumbled upon this discovery: the shell=20
> doesn't matter, your current directory does (see the=20
> transcript below).  If you are currently in a directory on a=20
> local hard drive such as C:, authentication always fails, but=20
> if you are currently on a network drive, in my case H:,=20
> password prompting always occurs as documented.
> Prompting also occurs correctly if the drive is local but you=20
> are mounting it as if it were a network drive (for reasons I=20
> won't go into, my D: and E: drives are "network" mounts of=20
> subdirectories on C:).
> Here is a sample session in cmd.exe:
>=20
> --------------------------------------------------------------
> ----------------------------------------------------------------
>=20
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>=20
> H:\>c:
>=20
> C:\>psql
> psql: FATAL:  password authentication failed for user "dhg0417"
>=20
> C:\>psql -W
> psql: FATAL:  password authentication failed for user "dhg0417"
>=20
> C:\>h:
>=20
> H:\>psql
> Password:
> Welcome to psql 8.1.1, the PostgreSQL interactive terminal.
>=20
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help with psql commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>=20
> Warning: Console code page (437) differs from Windows code page (1252)
>          8-bit characters may not work correctly. See psql reference
>          page "Notes for Windows users" for details.
>=20
> dhg0417=3D> \q
>=20
> H:\>d:
>=20
> D:\>psql
> Password:
> Welcome to psql 8.1.1, the PostgreSQL interactive terminal.
>=20
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help with psql commands
>        \g or terminate with semicolon to execute query
>        \q to quit
>=20
> Warning: Console code page (437) differs from Windows code page (1252)
>          8-bit characters may not work correctly. See psql reference
>          page "Notes for Windows users" for details.
>=20
> dhg0417=3D>
>=20
> --------------------------------------------------------------
> -------------------------------------------------------------
>=20
> My guess is that psql treats requests while logged in to a=20
> network drive as "network" connections, while requests from=20
> the C: drive seem to be treated as "local" connections.=20=20
> Should I submit this as a bug or is this known behaviour?
>=20
>=20
> Bruce Momjian wrote:
> > Mike  Grant wrote:
> > > I get the same thing with 8.0.4, on Windows XP Professional.
> >
> > I am still confused.  I tried 'psql -W test' in the mingw shell=20
> > window, and in a 'cmd.exe' window, and both prompted me for a=20
> > password.  I even tried a command.com window.
> >
> > Are you using a Cygwin window perhaps?
> >
> >=20
> ----------------------------------------------------------------------
> > -----
> >
> >
> > >
> > > ~Mike
> > >
> > > Bruce Momjian wrote:
> > > > Todd wrote:
> > > > >
> > > > > The following bug has been logged online:
> > > > >
> > > > > Bug reference:      2000
> > > > > Logged by:          Todd
> > > > > Email address:      tdoolitt@comcast.net
> > > > > PostgreSQL version: 8.1 Beta 4
> > > > > Operating system:   Windows Xp home
> > > > > Description:        psql does not prompt for password
> > > > > Details:
> > > > >
> > > > > psql -U postgres does not prompt for password and=20
> responds with...
> > > > >
> > > > > psql: FATAL: password authentication failed for user=20
> "postgres".
> > > > >
> > > > > even when I pass the -W option it doesn't prompt for password=20
> > > > > and gives me the error above.  I deleted and recreated my=20
> > > > > cluster and get the same result.  I can connect to=20
> the database using PgAdmin as user postgres.
> > > >
> > > > I have no idea what is causing this, but I have never heard of=20
> > > > this problem before.

pgsql-bugs by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: BUG #2168: 45.000.000 records too much?
Next
From: Tom Lane
Date:
Subject: Re: BUG #2168: 45.000.000 records too much?