Create Read Only User

suggest change
CREATE USER readonly WITH ENCRYPTED PASSWORD 'yourpassword';
GRANT CONNECT ON DATABASE <database_name> to readonly;

GRANT USAGE ON SCHEMA public to readonly;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly;

These grants apply only to tables and sequences that already exist in schema public. They do not cover objects created later, or objects in other schemas. See default privileges for future objects.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents