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@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