How can we give select access at database level in postgreSQL.

At present I had created new user with select access on all tables in a schema using below syntax.

grant select on all tables in schema public to readonly;

But again if any new table gets created, the user readonly is not able to access the newly created table. I need to again execute the same syntax for giving access.

Is there any generic way, where we can give select privilege at database level just like MySQL. So that if any new table is created, the new table will be accessed by user automatically.



Browse other questions tagged or ask your own question.