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