Re: \c connects as another user instead I want in psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)yahoo(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: \c connects as another user instead I want in psql
Date: 2001-05-07 15:11:42
Message-ID: 21261.989248302@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>> Really? We are removing usesysid? Seems the admin will no longer be
>>> able to choose the users id, right?
>>
>> Not that this was ever useful.

> Except for re-adding users.

Yes. In theory, the correct answer to that is to add referential
integrity checks that prevent you from dropping a user that still
owns any objects. In practice, this is impractical because users
span a whole database installation. We have no reasonable way to
check whether the user owns objects in other databases that cannot
be seen from the DB where we are issuing the DROP USER command.

Therefore, for the foreseeable future it will be important to be
able to reverse a DROP USER command --- ie, recreate a user with
the same user identifier previously used.

After thinking about that for awhile, I am inclined to change my
previous position: we should not switch over to using the OIDs of
pg_shadow rows as user identifiers. usesysid should continue to
exist. Ditto for groups --- grosysid can't go away either.

I think the original motivation for wanting to eliminate these columns
was that we need usesysid and grosysid to be distinct (can't use the
same ID for both a user and a group). Using OIDs as IDs would fix
that, but it's overkill. Wouldn't it be sufficient to use an
installation-wide sequence object to assign new IDs for new users and
groups? We have no such animals at the present, but I see no reason
why we couldn't make one.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-05-07 15:22:53 Re: A problem with new pg_dump
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-05-07 15:00:22 Re: File system performance and pg_xlog