0

I created new role named "support" in my PostgreSQL. Now I need grant "READ ONLY" permissions for this role an ALL exists databases/tables. Also I need automatically granted same permissions on each DB that will created in future.

I unsuccessfully tried next queries for grant permissions in new databases (Can not select from new database tables ):

ALTER DEFAULT PRIVILEGES FOR ROLE support GRANT SELECT ON TABLES TO PUBLIC;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES to support;

I looked at this post, but it about all tables within single database. It not enough for me.

4
  • I looked this post. It's about all tables in one database. I need all tables in all databases on my server. Mar 10 '20 at 16:49
  • When you know how to catch a fish, it's reasonable to expect that you can catch other fishes of that kind using the same technique.
    – mustaccio
    Mar 10 '20 at 17:11
  • @mustaccio, I have few hundreds databases on my server, so i search simple solution without iterate queries on each of them. All help will be appreciate. Mar 10 '20 at 17:16
  • There is no other solution. Mar 10 '20 at 21:55