Thread: Has every postgreSQL database own users?

Has every postgreSQL database own users?

From
Stanimir Stanev
Date:
hi all

Has every postgreSQL database own users?

for example:

If I have databases with name "db1" and "db2". I want to have user
"user1" for "db1" and user "user1" (same name, but with other password)
for "db2". Is this available?

10x
Stanimir

Attachment

Re: [SQL] Has every postgreSQL database own users?

From
Remigiusz Sokolowski
Date:
> hi all
>
> Has every postgreSQL database own users?
>
> for example:
>
> If I have databases with name "db1" and "db2". I want to have user
> "user1" for "db1" and user "user1" (same name, but with other password)
> for "db2". Is this available?
AFAIK this is not possible. Users of postgres are stored in table
pg_shadow and this table is shared between all of databases. I'm not sure
if this is also in case when You create another database system, but
suppose that even in this case user must be unique.
    Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *
-----------------------------------------------------------------*****----------


Re: [SQL] Has every postgreSQL database own users?

From
Stanimir Stanev
Date:
10x for reply

OK, but every database has pg_user table. Why this table is there?

Remigiusz Sokolowski wrote:

> > hi all
> >
> > Has every postgreSQL database own users?
> >
> > for example:
> >
> > If I have databases with name "db1" and "db2". I want to have user
> > "user1" for "db1" and user "user1" (same name, but with other password)
> > for "db2". Is this available?
> AFAIK this is not possible. Users of postgres are stored in table
> pg_shadow and this table is shared between all of databases. I'm not sure
> if this is also in case when You create another database system, but
> suppose that even in this case user must be unique.
>         Rem
>
> -------------------------------------------------------------------*------------
> Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *
> -----------------------------------------------------------------*****----------



Attachment

Re: [SQL] Has every postgreSQL database own users?

From
Remigiusz Sokolowski
Date:
>
> 10x for reply
>
> OK, but every database has pg_user table. Why this table is there?
>
> Remigiusz Sokolowski wrote:
>
pg_user is some kind of view on table pg_shadow - this is like with
passwords in Linux and some other Unixes - in pg_user You have name of
user, his privileges, but not passwords - check it. Besides this view is
also shared between all databases.
    Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *
-----------------------------------------------------------------*****----------


Re: [SQL] Has every postgreSQL database own users?

From
Maarten Boekhold
Date:
>
> OK, but every database has pg_user table. Why this table is there?
>

They don't have their own copy. The pg_user (and pg_shadow) table are
shared between all databases (think of it as that every database has a
symlink to the 'global' pg_user table).

Maarten

--

Maarten Boekhold, boekhold@tibco.com
TIBCO Finance Technology Inc.
The Atrium
Strawinskylaan 3051
1077 ZX Amsterdam, The Netherlands
tel: +31 20 3012158, fax: +31 20 3012358
http://www.tibco.com