Re: Where are all the users?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Kay-Uwe Genz <kay-uwe(dot)genz(at)web(dot)de>
Cc: gnari <gnari(at)simnet(dot)is>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Where are all the users?
Date: 2004-08-04 15:17:58
Message-ID: 1091632678.8622.430.camel@camel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2004-08-03 at 05:57, Kay-Uwe Genz wrote:

>
> But pg_user is a view and cant referenced. So I try to use pg_shadow,
> but PG say that this is an System table and I cant use it.

so you real question is probably:
how can i modify the structure of system tables ?

you do not say what your ultimate purpose is, so I cannot see if the
FOREIGN KEY reference is necessary, but if you really need it, it
possibly
might be done by starting postgres in single-user mode, with correct
options.

my guess is that this should only be done by someone who knows what he
is
doing.

gnari

Hi @ all, hi gnari,

I'm sorry about my unspecified question. Second try. I want to use the
User-ID from the system-Tables to identify a user. I have a table
"journal" where I save dataset about transactions inside my A!
pplication (like change datas, insert, ...) and I need Information, who
does this actions. Because the Database Users are the same as the
Applikation users, I thing it is a good solution, to user the
System-Information and user the userid from pg_user (or pg_shadow - that
the table) as an foreign key.

But the system say, that the table is an system table an I can't create
the Key.

Have anybody an solution?

I think the way you are "supposed to do this" is by using the
CURRENT_USER variable to get the current user name for the person
connected. If you are stuck on using the system id's you could create
your own triggers to verify the entry in pg_user.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gaetano Mendola 2004-08-04 15:34:56 Re: Tuning queries on large database
Previous Message Jerry LeVan 2004-08-04 15:04:49 Simplfied Bytea input/output?