I tried to run simple sql command:
select * from site_adzone;
and I got this error
ERROR: permission denied for relation site_adzone
What could be the problem here?
I tried also to do select for other tables and got same issue. I also tried to do this:
GRANT ALL PRIVILEGES ON DATABASE jerry to tom;
but I got this response from console
WARNING: no privileges were granted for "jerry"
Do you have some idea what can be wrong?
This frequently happens when you create a table as user postgres and then try to access it as an ordinary user. In this case it is best to log in as postgres again and use ALTER TABLE OWNER TO someuser to change the table ownership to the user who will be using the table.
I was faced with this problem once. just change the database user to a superuser and your problem is solved.
ALTER USER myuser WITH SUPERUSER;
Make sure you log into psql as the owner of the tables. to find out who own the tables use
\dt
psql -h CONNECTION_STRING DBNAME -U OWNER_OF_THE_TABLES
then you can run the GRANTS
As you are looking for select permissions, I would suggest you to grant only select rather than all privileges. You can do this by: