Re: Re: How to determine if a user exists.. - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Re: How to determine if a user exists..
Date
Msg-id Pine.LNX.4.30.0104231732200.758-100000@peter.localdomain
Whole thread Raw
In response to Re: How to determine if a user exists..  ("Dominic J. Eidson" <sauron@the-infinite.org>)
List pgsql-hackers
Dominic J. Eidson writes:

> On Mon, 23 Apr 2001, Joel Burton wrote:
>
> > pg_user holds users
> >
> > (passwords in pg_shadow)
>
> I doubt the -hackers people would let me add SPI_* stuff into libpq, just
> to retrieve whether a user exists or not..

You wouldn't have to do that.  There are better ways to read system tables
in the backend.  See FAQ_DEV.

> My first thought was to check
> the existance of users against $PGDATA/pg_pwd... One question I'd have
> there, is whether pg_pwd always exists (or, can be relied upon existing.)?

No it doesn't and no you can't.

The best way to verify a user's existence in the context of a new
authentication method is to not do that at all.  None of the other methods
do it, the existence of a user is checked when authentication has
completed and the backend starts.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RFC: planner statistics in 7.2
Next
From: Peter Eisentraut
Date:
Subject: Re: row name length