Re: Strange Grant behavior in postgres 8.3

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Schwaighofer Clemens <clemens(dot)schwaighofer(at)tequila(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange Grant behavior in postgres 8.3
Date: 2009-02-18 04:15:37
Message-ID: 499B8B69.1080505@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Schwaighofer Clemens wrote:
> So what do I do wrong? Even if I do the GRANT command as user 'foo'
> who is the database owner, I still cannot select with the user 'bar'.
> It only works if I set GRANT rights for the TABLE itself:
>
> as user 'foo' logged in
> => grant all on table test to bar;
>

that is correct. DATABASE privileges relate to connecting to the
database, permissions to create objects and so forth.

each object in the database has its own access rights.

for typical application use, I create teh database so the primary
application account owns the database, then let that account create all
the tables so it owns those too.

$ sudo -u postgres createuser someuser
$ sudo -u postgres createdb -o someuser somedb

then access this database with that user to create the tables and such

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clemens Schwaighofer 2009-02-18 04:20:33 Re: Strange Grant behavior in postgres 8.3
Previous Message Schwaighofer Clemens 2009-02-18 03:42:42 Re: transfering tables into other schema