Re: Strange Grant behavior in postgres 8.3

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Schwaighofer Clemens *EXTERN*" <clemens(dot)schwaighofer(at)tequila(dot)jp>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Strange Grant behavior in postgres 8.3
Date: 2009-02-17 12:06:42
Message-ID: D960CB61B694CF459DCFB4B0128514C2030E62CD@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Schwaighofer Clemens wrote:
> Version:
> PostgreSQL 8.3.5 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real(Debian 4.3.2-1) 4.3.2
>
> I have a DB "foo" created and owned by postgres.
>
> No I created another role called "bar" and with the user postgres in
> the db foo I did:
>
> #> grant all on foo to bar;

That statement is wrong.
It should be:

GRANT ALL ON DATABASE foo TO bar;

> when I select from pg_database I can see the correct line
>
> bar=CTc/postgres for the db foo
>
> I login with user bar to foo
>
> $ psql -U bar -h localhost foo
>
> but I cannot select anything from any table.

That is ok, because you have no permissions on schemata and tables.

> Now the strange part.
>
> I grant to one table only a all privileges
> #> grant all on table nodes to bar
>
> $> \z nodes
> Schema | Name | Type | Access privileges
> --------+-------+-------+---------------------------------------------------
> public | nodes | table | {postgres=arwdxt/postgres,foo=arwdxt/postgres}

That is very strange, because the user in your example is "bar" and not "foo".

> and then the user bar could read from all tables.

That is unlikely.

> What am I doing wrong? Or where can I look if I missed something

It seems that some of your statements or results are different
from what actually happened.

Try to reproduce it with a new clean database, and then copy and
paste what you did and what results you got so that we can reproduce
the behaviour.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-02-17 12:19:14 Re: transfering tables into other schema
Previous Message Raymond O'Donnell 2009-02-17 10:08:09 Re: transfering tables into other schema