Listing users

Started by Aaron Rouseover 24 years ago7 messagesgeneral
Jump to latest
#1Aaron Rouse
pgsql@happyhacker.com

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?

#2Keary Suska
hierophant@pcisys.net
In reply to: Aaron Rouse (#1)
Re: Listing users

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"

Show quoted text

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)

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Keary Suska (#2)
Re: 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

#4Keary Suska
hierophant@pcisys.net
In reply to: Peter Eisentraut (#3)
Re: Listing users

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"

Show quoted text

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

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Keary Suska (#4)
Re: Listing users

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

#6infotechsys.wayne@verizon.net
infotechsys.wayne@verizon.net
In reply to: Peter Eisentraut (#3)
Re: Listing users

How would you find out who was authorize to use what DB?
WAyne

Peter Eisentraut wrote:

Show quoted text

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

#7Peter Eisentraut
peter_e@gmx.net
In reply to: Keary Suska (#4)
Re: Listing users

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