Check out example codes for "psql set access privileges". It will help you in understanding the concepts better.

Code Example 1

REVOKE ALL ON DATABASE example_database FROM example_user;
GRANT CONNECT ON DATABASE example_database TO example_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO example_user;

Learn ReactJs, React Native from akashmittal.com