Thread: Listing users

Listing users

From
"Aaron Rouse"
Date:
    I am trying to connect to a PGSQL 7.1.3 using PGAdmin II and I am
getting a error that says the user I am trying to connect with does not
exist.  How can I get a list of the users in the database from the psql
console when su'd to the postgres user?


Re: Listing users

From
Keary Suska
Date:
The easiest way is to cat ~postgres/data/global/pg_pwd, but if that doesn't
tell you what you need to know, you can SELECT * FROM pg_shadow (works when
connected to any database as long as you are the postgres superuser).

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: "Aaron Rouse" <pgsql@happyhacker.com>
> Date: Sun, 21 Oct 2001 21:51:06 -0500
> To: <pgsql-general@postgresql.org>
> Subject: [GENERAL] Listing users
>
> I am trying to connect to a PGSQL 7.1.3 using PGAdmin II and I am
> getting a error that says the user I am trying to connect with does not
> exist.  How can I get a list of the users in the database from the psql
> console when su'd to the postgres user?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


Re: Listing users

From
Peter Eisentraut
Date:
Keary Suska writes:

> The easiest way is to cat ~postgres/data/global/pg_pwd,

No way.

> but if that doesn't tell you what you need to know, you can SELECT *
> FROM pg_shadow (works when connected to any database as long as you
> are the postgres superuser).

That or SELECT * FROM pg_user;

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


Re: Listing users

From
Keary Suska
Date:
>> The easiest way is to cat ~postgres/data/global/pg_pwd,
>
> No way.

What does "no way" mean? That works on my installation (7.1.3). It may be
dependent on the authentication method used.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: Peter Eisentraut <peter_e@gmx.net>
> Date: Tue, 23 Oct 2001 22:42:20 +0200 (CEST)
> To: Keary Suska <hierophant@pcisys.net>
> Cc: PostgreSQL <pgsql-general@postgresql.org>
> Subject: Re: [GENERAL] Listing users
>
> Keary Suska writes:
>
>> The easiest way is to cat ~postgres/data/global/pg_pwd,
>
> No way.
>
>> but if that doesn't tell you what you need to know, you can SELECT *
>> FROM pg_shadow (works when connected to any database as long as you
>> are the postgres superuser).
>
> That or SELECT * FROM pg_user;
>
> --
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
>


Re: Listing users

From
Tom Lane
Date:
Keary Suska <hierophant@pcisys.net> writes:
> The easiest way is to cat ~postgres/data/global/pg_pwd,
>>
>> No way.

> What does "no way" mean?

Means "it don't work if you're not on the database server machine,
nor if you're not logged in as the postgres user".  A proper solution
is an SQL query that works across a remote database connection...

            regards, tom lane

Re: Listing users

From
wayne
Date:
How would you find out who was authorize to use what DB?
WAyne

Peter Eisentraut wrote:

> Keary Suska writes:
>
> > The easiest way is to cat ~postgres/data/global/pg_pwd,
>
> No way.
>
> > but if that doesn't tell you what you need to know, you can SELECT *
> > FROM pg_shadow (works when connected to any database as long as you
> > are the postgres superuser).
>
> That or SELECT * FROM pg_user;
>
> --
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html


Re: Listing users

From
Peter Eisentraut
Date:
Keary Suska writes:

> >> The easiest way is to cat ~postgres/data/global/pg_pwd,
> >
> > No way.
>
> What does "no way" mean? That works on my installation (7.1.3). It may be
> dependent on the authentication method used.

The pg_pwd file may at random times contain random information that is
similar to the list of users, but it is in no way the "easiest way" to
list all users.

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