Re: pg_stat_database shows userid as OID

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_database shows userid as OID
Date: 2002-11-17 21:24:49
Message-ID: 200211172124.gAHLOnS14795@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> > In the pg_stat_activity view, the usesysid is shown as having type Oid.
> > However pg_shadow says it's an integer. Is there a reason?
>
> There's been disagreement for a long time over whether userids should be
> OIDs or ints. If you want to introduce consistency then it's going to
> take a lot more than a one-line patch. (First you'll need to convince
> the partisans involved which answer is the right one.)
>
> > Looks like a bug.
>
> Not as long as OID is 4 bytes.
>
> I'd recommend not making any piecemeal changes, especially not when
> there's not yet a consensus which way to converge.

Well, seems we should make it consistent at least. Let's decide and
make it done. I think some wanted it to be an int so they could use the
same unix uid for pg_shadow, but I think we aren't using that idea much
anymore. However, right now, it looks like the super user is '1', and
other users start numbering from 100. That at least suggests int rather
than oid.

I am not particular in what we choose, but I do think there is a good
argument to make it consistent.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-11-17 21:33:03 CLUSTER ALL syntax
Previous Message Tom Lane 2002-11-17 20:19:54 Re: Getting float8 data into cube?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-11-17 21:33:03 CLUSTER ALL syntax
Previous Message Alvaro Herrera 2002-11-17 20:13:52 Re: pg_stat_database shows userid as OID