Where are all the users?

Started by Kay-Uwe Genzover 21 years ago8 messagesgeneral
Jump to latest
#1Kay-Uwe Genz
kug1977@web.de

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

#2Kay-Uwe Genz
kay-uwe.genz@web.de
In reply to: Kay-Uwe Genz (#1)
Re: Where are all the users?

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

#3Ragnar Hafstað
gnari@simnet.is
In reply to: Kay-Uwe Genz (#1)
Re: Where are all the users?

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

#4Kay-Uwe Genz
kay-uwe.genz@web.de
In reply to: Ragnar Hafstað (#3)
Re: Where are all the users?

<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" &lt;gnari@simnet.is&gt; schrieb am 01.08.04 19:11:26:<BR><BR>From: "Kay-Uwe.Genz" &lt;kay-uwe.genz@web.de&gt;<BR>&gt; <BR>&gt; Am 01.08.2004 um 10:44 schrieb Kay-Uwe Genz:<BR>&gt; <BR>&gt; &gt; Hi @ all,<BR>&gt; &gt;<BR>&gt; &gt; I want to reference the User-ID PG use as an FOREIGN KEY in a tabel of <BR>&gt; &gt; my DB. But I saw that pg_user is a view. Where are the information I <BR>&gt; &gt; 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&quot; 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!&nbsp;&nbsp;<br>Jetzt neu bei WEB.DE FreeMail: <A HREF="http://freemail.web.de/?mc=021193&quot;&gt;&lt;B&gt;http://freemail.web.de/?mc=021193&lt;/B&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;

#5Ragnar Hafstað
gnari@simnet.is
In reply to: Kay-Uwe Genz (#4)
Re: Where are all the users?

"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

#6Kay-Uwe Genz
kay-uwe.genz@web.de
In reply to: Ragnar Hafstað (#5)
Re: Where are all the users?

<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>&gt;<BR>&gt; But pg_user is a view and cant referenced. So I try to use pg_shadow,<BR>&gt; 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>&nbsp;</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&nbsp;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>&nbsp;</P><P>But the system say, that the table is an system table an I can't create the Key.</P><P>&nbsp;</P><P>Have anybody an solution?</P><P>&nbsp;</P><P>Thanks</P><P>&nbsp;</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&quot; 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&nbsp;&nbsp;<br>Informationen unter: <A HREF="http://freemail.web.de/?mc=021199&quot;&gt;&lt;B&gt;http://freemail.web.de/?mc=021199&lt;/B&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;

#7Robert Treat
xzilla@users.sourceforge.net
In reply to: Kay-Uwe Genz (#6)
Re: Where are all the users?

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

#8Jim Seymour
jseymour@LinxNet.com
In reply to: Kay-Uwe Genz (#1)
Re: Where are all the users?

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