Privilege problems: access denied on select for owner?

From: Nathan Jahnke <njahnke(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Privilege problems: access denied on select for owner?
Date: 2009-08-03 18:39:08
Message-ID: 89e8c360908031139t23822c9bh4cc59896a17d074f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Having some trouble today accessing tables in a database:

sample=# \l+
List of databases
Name | Owner | Encoding | Tablespace | Description
-----------+----------+----------+------------+---------------------------
postgres | postgres | UTF8 | pg_default |
root | root | UTF8 | pg_default |
sample | sample | UTF8 | pg_default |
[...]

sample=# \z users
Access privileges for database "sample"
Schema | Name | Type | Access privileges
--------+--------------+-------+-------------------
public | users | table |
(1 row)

sample=#

So the role "sample" owns the database "sample" and has default
privileges on the table "users" in that database. From the manual:

"There is no need to grant privileges to the owner of an object
(usually the user that created it), as the owner has all privileges by
default."

But:

sample(at)server:~$ psql -U sample sample
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

sample=> select * from users;
ERROR: permission denied for relation users
sample=>

I can SELECT from this table if I give the privilege to "sample" by
root on the table. But this is not what I want; I want "sample" to
have all privileges on all tables in the database "sample".

Any insight would be much appreciated.

Thanks,

Nathan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-08-03 18:49:25 Re: \copy command error
Previous Message Andreas Kalsch 2009-08-03 18:32:28 character 0xe29986 of encoding "UTF8" has no equivalent in "LATIN2"