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

From Bruce Momjian
Subject Re: BUG #2000: psql does not prompt for password
Date
Msg-id 200601192159.k0JLxOW00283@candle.pha.pa.us
Whole thread Raw
In response to Re: BUG #2000: psql does not prompt for password  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #2177: (minor:) pgsql: Trailing semicolon on \d treated
Next
From: Seneca Cunningham
Date:
Subject: Re: BUG #2168: 45.000.000 records too much?