pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to list user accounts?
4+ messages / 4 participants
[nested] [flat]
* How to list user accounts?
@ 2005-07-12 18:59 Thanh Q Lam <thanh.q.lam@alcatel.com>
0 siblings, 3 replies; 4+ messages in thread
From: Thanh Q Lam @ 2005-07-12 18:59 UTC (permalink / raw)
To: pgsql-admin
Hi,
Is there a command/option to list all database user accounts in postgres?
Thanks,
Thanh
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to list user accounts?
@ 2005-07-12 19:10 Bruno Wolff III <bruno@wolff.to>
parent: Thanh Q Lam <thanh.q.lam@alcatel.com>
2 siblings, 0 replies; 4+ messages in thread
From: Bruno Wolff III @ 2005-07-12 19:10 UTC (permalink / raw)
To: Thanh Q Lam <thanh.q.lam@alcatel.com>; +Cc: pgsql-admin
On Tue, Jul 12, 2005 at 14:59:27 -0400,
Thanh Q Lam <thanh.q.lam@alcatel.com> wrote:
>
> Is there a command/option to list all database user accounts in postgres?
select usename from pg_user;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to list user accounts?
@ 2005-07-12 19:12 Scott Marlowe <smarlowe@g2switchworks.com>
parent: Thanh Q Lam <thanh.q.lam@alcatel.com>
2 siblings, 0 replies; 4+ messages in thread
From: Scott Marlowe @ 2005-07-12 19:12 UTC (permalink / raw)
To: Thanh Q Lam <thanh.q.lam@alcatel.com>; +Cc: pgsql-admin
On Tue, 2005-07-12 at 13:59, Thanh Q Lam wrote:
> Hi,
>
> Is there a command/option to list all database user accounts in postgres?
From the psql monitor:
\du
via sql:
SELECT u.usename AS "User name",
u.usesysid AS "User ID",
CASE WHEN u.usesuper AND u.usecreatedb THEN CAST('superuser, create
database' AS pg_catalog.text)
WHEN u.usesuper THEN CAST('superuser' AS pg_catalog.text)
WHEN u.usecreatedb THEN CAST('create database' AS
pg_catalog.text)
ELSE CAST('' AS pg_catalog.text)
END AS "Attributes"
FROM pg_catalog.pg_user u
ORDER BY 1;
(what psql does behind the scenes when you type \du)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: How to list user accounts?
@ 2005-07-12 19:16 Michael Fuhr <mike@fuhr.org>
parent: Thanh Q Lam <thanh.q.lam@alcatel.com>
2 siblings, 0 replies; 4+ messages in thread
From: Michael Fuhr @ 2005-07-12 19:16 UTC (permalink / raw)
To: Thanh Q Lam <thanh.q.lam@alcatel.com>; +Cc: pgsql-admin
On Tue, Jul 12, 2005 at 02:59:27PM -0400, Thanh Q Lam wrote:
>
> Is there a command/option to list all database user accounts in postgres?
If you're using psql then see "Meta-Commands" in the psql documentation;
otherwise see your client's documentation. You could also query
the system catalogs directly.
http://www.postgresql.org/docs/8.0/static/app-psql.html
http://www.postgresql.org/docs/8.0/static/catalogs.html
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-07-12 19:16 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-12 18:59 How to list user accounts? Thanh Q Lam <thanh.q.lam@alcatel.com>
2005-07-12 19:10 ` Bruno Wolff III <bruno@wolff.to>
2005-07-12 19:12 ` Scott Marlowe <smarlowe@g2switchworks.com>
2005-07-12 19:16 ` Michael Fuhr <mike@fuhr.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox