Thread: BUG #2000: psql does not prompt for password

BUG #2000: psql does not prompt for password

From
"Todd"
Date:
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 responds with...

psql: FATAL: password authentication failed for user "postgres".

even when I pass the -W option it doesn't prompt for password and gives me
the error above.  I deleted and recreated my cluster and get the same
result.  I can connect to the database using PgAdmin as user postgres.

Re: BUG #2000: psql does not prompt for password

From
Bruce Momjian
Date:
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 responds with...
>
> psql: FATAL: password authentication failed for user "postgres".
>
> even when I pass the -W option it doesn't prompt for password and gives me
> the error above.  I deleted and recreated my cluster and get the same
> result.  I can connect to the database using PgAdmin as user postgres.

I have no idea what is causing this, but I have never heard of this
problem before.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: BUG #2000: psql does not prompt for password

From
"Mike Grant"
Date:
I get the same thing with 8.0.4, on Windows XP Professional.

~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 responds with...
> >
> > psql: FATAL: password authentication failed for user "postgres".
> >
> > even when I pass the -W option it doesn't prompt for password and gives me
> > the error above.  I deleted and recreated my cluster and get the same
> > result.  I can connect to the database using PgAdmin as user postgres.
>
> I have no idea what is causing this, but I have never heard of this
> problem before.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

Re: BUG #2000: psql does not prompt for password

From
Bruce Momjian
Date:
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 window,
and in a 'cmd.exe' window, and both prompted me for a password.  I even
tried a command.com window.

Are you using a Cygwin window perhaps?

---------------------------------------------------------------------------


>
> ~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 responds with...
> > >
> > > psql: FATAL: password authentication failed for user "postgres".
> > >
> > > even when I pass the -W option it doesn't prompt for password and gives me
> > > the error above.  I deleted and recreated my cluster and get the same
> > > result.  I can connect to the database using PgAdmin as user postgres.
> >
> > I have no idea what is causing this, but I have never heard of this
> > problem before.
> >
> > --
> >   Bruce Momjian                        |  http://candle.pha.pa.us
> >   pgman@candle.pha.pa.us               |  (610) 359-1001
> >   +  If your life is a hard drive,     |  13 Roberts Road
> >   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: BUG #2000: psql does not prompt for password

From
"Duncan Goodwin"
Date:
I just installed the 8.1.1 release on Windows XP Pro and encountered a
very strange problem that seems to be related to your problem.  My
pg_hba.conf is the default out-of-the-box config (i.e local IPv4
connections are configured as: host all all 127.0.0.1/32 md5).  I tried
running psql from different shells, cmd.exe and 4NT, as well as using
the shortcut to cmd.exe installed by the PostgreSQL installer.  In some
cases I was prompted for a password, but in other cases, psql would not
prompt me, even if I tried to force it with -W.
After several hours of testing different login users and pg_hba.conf
entries I stumbled upon this discovery: the shell doesn't matter, your
current directory does (see the transcript below).  If you are
currently in a directory on a local hard drive such as C:,
authentication always fails, but if you are currently on a network
drive, in my case H:, password prompting always occurs as documented.
Prompting also occurs correctly if the drive is local but you are
mounting it as if it were a network drive (for reasons I won't go into,
my D: and E: drives are "network" mounts of subdirectories on C:).
Here is a sample session in cmd.exe:


------------------------------------------------------------------------------------------------------------------------------

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

H:\>c:

C:\>psql
psql: FATAL:  password authentication failed for user "dhg0417"

C:\>psql -W
psql: FATAL:  password authentication failed for user "dhg0417"

C:\>h:

H:\>psql
Password:
Welcome to psql 8.1.1, the PostgreSQL interactive terminal.

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

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.

dhg0417=> \q

H:\>d:

D:\>psql
Password:
Welcome to psql 8.1.1, the PostgreSQL interactive terminal.

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

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.

dhg0417=>


---------------------------------------------------------------------------------------------------------------------------

My guess is that psql treats requests while logged in to a network
drive as "network" connections, while requests from the C: drive seem
to be treated as "local" connections.  Should I submit this as a bug or
is this known behaviour?


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 window,
> and in a 'cmd.exe' window, and both prompted me for a password.  I even
> tried a command.com window.
>
> Are you using a Cygwin window perhaps?
>
> ---------------------------------------------------------------------------
>
>
> >
> > ~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 responds with...
> > > >
> > > > psql: FATAL: password authentication failed for user "postgres".
> > > >
> > > > even when I pass the -W option it doesn't prompt for password and gives me
> > > > the error above.  I deleted and recreated my cluster and get the same
> > > > result.  I can connect to the database using PgAdmin as user postgres.
> > >
> > > I have no idea what is causing this, but I have never heard of this
> > > problem before.
> > >
> > > --
> > >   Bruce Momjian                        |  http://candle.pha.pa.us
> > >   pgman@candle.pha.pa.us               |  (610) 359-1001
> > >   +  If your life is a hard drive,     |  13 Roberts Road
> > >   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 5: don't forget to increase your free space map settings
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> >
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

Re: BUG #2000: psql does not prompt for password

From
"Magnus Hagander"
Date:
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.

Re: BUG #2000: psql does not prompt for password

From
Bruce Momjian
Date:
Duncan, do you have answers to any of these questions?

---------------------------------------------------------------------------

Magnus Hagander wrote:
> 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
>
>
> > -----Original Message-----
> > From: pgsql-bugs-owner@postgresql.org
> > Sent: Thursday, December 22, 2005 7:14 PM
> > To: pgsql-bugs@postgresql.org
> > Subject: Re: [BUGS] BUG #2000: psql does not prompt for password
> >
> > I just installed the 8.1.1 release on Windows XP Pro and
> > encountered a very strange problem that seems to be related
> > to your problem.  My pg_hba.conf is the default
> > out-of-the-box config (i.e local IPv4 connections are
> > configured as: host all all 127.0.0.1/32 md5).  I tried
> > running psql from different shells, cmd.exe and 4NT, as well
> > as using the shortcut to cmd.exe installed by the PostgreSQL
> > installer.  In some cases I was prompted for a password, but
> > in other cases, psql would not prompt me, even if I tried to
> > force it with -W.
> > After several hours of testing different login users and
> > pg_hba.conf entries I stumbled upon this discovery: the shell
> > doesn't matter, your current directory does (see the
> > transcript below).  If you are currently in a directory on a
> > local hard drive such as C:, authentication always fails, but
> > if you are currently on a network drive, in my case H:,
> > password prompting always occurs as documented.
> > Prompting also occurs correctly if the drive is local but you
> > are mounting it as if it were a network drive (for reasons I
> > won't go into, my D: and E: drives are "network" mounts of
> > subdirectories on C:).
> > Here is a sample session in cmd.exe:
> >
> > --------------------------------------------------------------
> > ----------------------------------------------------------------
> >
> > Microsoft Windows XP [Version 5.1.2600]
> > (C) Copyright 1985-2001 Microsoft Corp.
> >
> > H:\>c:
> >
> > C:\>psql
> > psql: FATAL:  password authentication failed for user "dhg0417"
> >
> > C:\>psql -W
> > psql: FATAL:  password authentication failed for user "dhg0417"
> >
> > C:\>h:
> >
> > H:\>psql
> > Password:
> > Welcome to psql 8.1.1, the PostgreSQL interactive terminal.
> >
> > 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
> >
> > 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.
> >
> > dhg0417=> \q
> >
> > H:\>d:
> >
> > D:\>psql
> > Password:
> > Welcome to psql 8.1.1, the PostgreSQL interactive terminal.
> >
> > 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
> >
> > 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.
> >
> > dhg0417=>
> >
> > --------------------------------------------------------------
> > -------------------------------------------------------------
> >
> > My guess is that psql treats requests while logged in to a
> > network drive as "network" connections, while requests from
> > the C: drive seem to be treated as "local" connections.
> > Should I submit this as a bug or is this known behaviour?
> >
> >
> > 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
> > > window, and in a 'cmd.exe' window, and both prompted me for a
> > > password.  I even tried a command.com window.
> > >
> > > Are you using a Cygwin window perhaps?
> > >
> > >
> > ----------------------------------------------------------------------
> > > -----
> > >
> > >
> > > >
> > > > ~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
> > responds with...
> > > > > >
> > > > > > psql: FATAL: password authentication failed for user
> > "postgres".
> > > > > >
> > > > > > even when I pass the -W option it doesn't prompt for password
> > > > > > and gives me the error above.  I deleted and recreated my
> > > > > > cluster and get the same result.  I can connect to
> > the database using PgAdmin as user postgres.
> > > > >
> > > > > I have no idea what is causing this, but I have never heard of
> > > > > this problem before.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073