I'm trying to create a new user in postgresql which have read only access to Databases. I followed this document I will just list out the commands I used
CREATE ROLE readaccess;
GRANT CONNECT ON DATABASE db_name TO readaccess;
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
For this I got the output as ERROR: permission denied for table log
I executed this commands as root user. I do check other blogs, all of them mentioned steps similar to this.
I tried SELECT * from log;
I was getting the output as ERROR: permission denied for table log
The root user have attributes : Create role, Create DB and
member of : {pg_read_all_settings,pg_read_all_stats,pg_stat_scan_tables,azure_pg_admin}
Can anyone help me on this, or share any of your thoughts