Re: pg_role vs. pg_shadow or pg_user

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Reichstadt <lxr(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_role vs. pg_shadow or pg_user
Date: 2012-03-14 21:52:44
Message-ID: 6214.1331761964@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Reichstadt <lxr(at)mac(dot)com> writes:
> in the documentation of 8.1 the concept of roles is outlined compared
> to users and groups at
> <http://www.postgresql.org/docs/8.1/static/user-manag.html>.

Um ... why are you reading 8.1 documentation while running 9.1? There
are likely to be some obsolete things in there.

> I also read today that pg_shadow is the real table containing the
> users as opposed to pg_user which is only a view and one never
> displaying anything but **** for the password. I don't have the link
> where that was,

Whereever it was, it was even more obsolete than the 8.1 docs.
pg_shadow has been a view (on pg_authid) for quite a while now.
Try "\d+ pg_shadow" in psql.

The reason this is such a mess is that we've changed the catalog
representation several times, each time leaving behind a view that
was meant to emulate the old catalog. For some time now, pg_authid
has been the ground truth, but it stores entries for both login and
non-login roles, which more or less correspond to what used to be
users and groups. pg_roles is the only non-protected view that
shows you all the entries.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2012-03-14 21:56:59 Re: Upgrade questions
Previous Message Mike Blackwell 2012-03-14 21:12:22 Re: pg_role vs. pg_shadow or pg_user