grant permission postgresql user admin code example
Example 1: how to give access to database in postgresql server to another user
GRANT permissions ON DATABASE dbname TO username;
Example 2: psql set access privileges
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;