postgres grant user all permissions on db code example
Example 1: grant all privileges database postgres to user
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO username;
Example 2: grant read only privileges postgres user
grant connect on database "mydatabase" to "user";
GRANT USAGE ON SCHEMA public TO "user";
GRANT SELECT ON ALL TABLES IN SCHEMA "public" TO "user";
ALTER DEFAULT PRIVILEGES IN SCHEMA "public"
GRANT SELECT ON TABLES TO "user";