Re: Reference pg_user ? - Mailing list pgsql-general

From Doug McNaught
Subject Re: Reference pg_user ?
Date
Msg-id m3k7s8h7ul.fsf@varsoon.denali.to
Whole thread Raw
In response to Reference pg_user ?  (Carsten Zerbst <carsten.zerbst@atlantec-es.com>)
List pgsql-general
Carsten Zerbst <carsten.zerbst@atlantec-es.com> writes:

> But I need some additional information like name, email-addres and the
> like, so i tried to use something like:
>
> test=# create table users (
> test(# shortname name references pg_user,
> test(# lastname varchar not null,
> test(# email varchar not null
> test(# );
> NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> check(s)
> ERROR:  Referenced relation "pg_user" is not a table
> NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> check(s)
> ERROR:  Referenced relation "pg_user" is not a table
>
> Is it somehow possible to reference the system catalog with
> the users ?

pg_user is a view, not a table.  The actual table is pg_shadow, which
is not (and shouldn't be) readable by non-superusers, so you may run
into problems there.

-Doug
--
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

pgsql-general by date:

Previous
From: Merrill Oveson
Date:
Subject: getting trigger to work
Next
From: Tom Lane
Date:
Subject: Re: locking problems