How do I grant permissions in Postgres? I followed the documentation, however it is not working.
$ psql tmadev
psql (9.2.4)
Type "help" for help.
tmadev=# grant all privileges on database tmadev to tma;
GRANT
tmadev=# \z sample
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+--------+-------+-------------------+--------------------------
public | sample | table | |
(1 row)
tmadev=# \q
Chloe@xps /srv/www/htdocs
$ psql -U tma tmadev
psql (9.2.4)
Type "help" for help.
tmadev=> select * from sample limit 2;
ERROR: permission denied for relation sample
STATEMENT: select * from sample limit 2;
ERROR: permission denied for relation sample
tmadev=>
tmadev=> \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
Chloe | Superuser, Create role, Create DB, Replication | {}
tma | | {}