Where are all the users?
Hi @ all,
I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of
my DB. But I saw that pg_user is a view. Where are the information I
need?
Thank for your help
Kay-Uwe Genz
Am 01.08.2004 um 10:44 schrieb Kay-Uwe Genz:
Show quoted text
Hi @ all,
I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of
my DB. But I saw that pg_user is a view. Where are the information I
need?Thank for your help
Kay-Uwe Genz
From: "Kay-Uwe.Genz" <kay-uwe.genz@web.de>
Am 01.08.2004 um 10:44 schrieb Kay-Uwe Genz:
Hi @ all,
I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of
my DB. But I saw that pg_user is a view. Where are the information I
need?
template1=# \d pg_user
gnari
<html><style>p {margin: 0px}</style><body bgcolor='#ffffff' style='font-size:9pt; font-family:Verdana; font-family: Verdana' ><STYLE>p {margin: 0px}</STYLE><P>"gnari" <gnari@simnet.is> schrieb am 01.08.04 19:11:26:<BR><BR>From: "Kay-Uwe.Genz" <kay-uwe.genz@web.de><BR>> <BR>> Am 01.08.2004 um 10:44 schrieb Kay-Uwe Genz:<BR>> <BR>> > Hi @ all,<BR>> ><BR>> > I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of <BR>> > my DB. But I saw that pg_user is a view. Where are the information I <BR>> > need?<BR><BR>template1=# d pg_user<BR><BR>gnari<BR><BR>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.</P><P>Kay-Uwe Genz<BR><BR></P><br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="http://img.web.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font!
-size:12px; line-height:17px;">Verschicken Sie romantische, coole und witzige Bilder per SMS! <br>Jetzt neu bei WEB.DE FreeMail: <A HREF="http://freemail.web.de/?mc=021193"><B>http://freemail.web.de/?mc=021193</B></A>&nbsp;&nbsp;</td></tr></table></body></html>
Import Notes
Resolved by subject fallback
"Kay-Uwe Genz" <kay-uwe.genz@web.de> :
"gnari" <gnari@simnet.is> schrieb am 01.08.04 19:11:26:
From: "Kay-Uwe.Genz" <kay-uwe.genz@web.de>
Am 01.08.2004 um 10:44 schrieb Kay-Uwe Genz:
Hi @ all,
I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of
my DB. But I saw that pg_user is a view. Where are the information I
need?template1=# d pg_user
gnari
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
<html><style>p {margin: 0px}</style><body bgcolor='#ffffff' style='font-size:9pt; font-family:Verdana; font-family: Verdana' ><P><STYLE>p {margin: 0px}</STYLE>><BR>> But pg_user is a view and cant referenced. So I try to use pg_shadow,<BR>> but PG say that this is an System table and I cant use it.<BR><BR>so you real question is probably:<BR>how can i modify the structure of system tables ?<BR><BR>you do not say what your ultimate purpose is, so I cannot see if the<BR>FOREIGN KEY reference is necessary, but if you really need it, it possibly<BR>might be done by starting postgres in single-user mode, with correct<BR>options.<BR><BR>my guess is that this should only be done by someone who knows what he is<BR>doing.<BR><BR>gnari<BR><BR>Hi @ all, hi gnari,</P><P> </P><P>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. </P><P> </P><P>But the system say, that the table is an system table an I can't create the Key.</P><P> </P><P>Have anybody an solution?</P><P> </P><P>Thanks</P><P> </P><P>Kay-Uwe<BR><BR></P><br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="http://img.web.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern <br>Informationen unter: <A HREF="http://freemail.web.de/?mc=021199"><B>http://freemail.web.de/?mc=021199</B></A>&nbsp;&nbsp;</td></tr></table></body></html>
Import Notes
Resolved by subject fallback
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
Kay-Uwe Genz <kug1977@web.de> wrote:
Hi @ all,
I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of
my DB. But I saw that pg_user is a view. Where are the information I
need?
Maybe you could \d the view and find out? *But* you have to have
the proper permissions to actually see/reference the data.
Jim