Saturday, June 17, 2017

Postgresql: Read-Only User



create user xxxxx with password 'yyyy';
GRANT connect ON DATABASE mydb1 TO xxxxx;
GRANT connect ON DATABASE mydb2 TO xxxxx;

\c mydb1
GRANT usage ON SCHEMA public TO xxxxx;
GRANT select ON ALL TABLES IN SCHEMA public TO xxxxx;
GRANT select ON ALL SEQUENCES IN SCHEMA public TO xxxxx;

\c mydb2
GRANT usage ON SCHEMA public TO xxxxx;
GRANT select ON ALL TABLES IN SCHEMA public TO xxxxx;
GRANT select ON ALL SEQUENCES IN SCHEMA public TO xxxxx;

7 comments:

James Zicrov said...

I think there is a need to look for some more information about MySQL and Postgre. This is perhaps the best combination to solve many such complex IT problems.

SSIS PostgreSql Read

Harsh Vardhan said...

You have written an excellent blog.keep sharing your knowledge.
Linux Training in Chennai
Linux Online Courses
Linux Course in Chennai

Anonymous said...

Hii Your blog really very fantastic and intresting. You mentioned many information thank you to provide this type of blog. If you want to know about dedicated server hosting. USA Dedicated Hosting is best choice for you. Please Visit.

Anonymous said...

Amazing blog....Thank you for the very good and meaningful blog. It is very helpful for all blog writers. In this article, you define how to start a blog you also defined what is the right way to choose the right way for the topic. if you want to write a new blog you have a great opportunity to write a blog on the new topic of Server hosting. You Should write on USA Dedicated Server it offers an amazing hosting solution to users.

Anonymous said...


Wow, so lovely I think there is a condition to look for more details about MySQL and Postgre.
the USA Dedicated ServerThis is perhaps the best combination to solve multiple such complex IT problems.

Anonymous said...

Having read this I believed it was rather enlightening. I appreciate you taking the time and energy to put this informative article like Oppo K3 with Snapdragon 710, rising selfie camera prodded on Amazon: Launch expected on July 19. If you are looking for the fastest and cheapest USA Dedicated Server you can ask us for more details and services.

Anonymous said...

It's an excellent article, mind-blowing … if you are looking for more information on dedicated server hosting, check out an Italy Dedicated Server Hosting, which is unlike anything else on the market.