I have a problem with ALTER DEFAULT PRIVILEGES. I grant the permission:
ALTER DEFAULT PRIVILEGES
FOR USER user_name
IN SCHEMA schema_name
GRANT SELECT ON TABLES TO user_name;
in next step I create a table
create table schema_name.a (q int);
Now, I connect to dabasabe using conn_user and try to read the data in the new table.
select * from schema_name.a
and I receive the error:
SQL Error [42501]: ERROR: permission denied for relation a
org.postgresql.util.PSQLException: ERROR: permission denied for relation a
Do you have any ideas why the error appears?