93 words, 1 min read
⚠️ This post links to an external website. ⚠️
The docs may say this:
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;ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO example_user;But the docs miss this:
GRANT USAGE ON SCHEMA public TO example_user;They're assuming the default
USAGEon public is still in place. In PostgreSQL 14 and earlier, the public schema had different defaults but in PostgreSQL 15 they tightened it and didn't update the docs (at the time of this post).
continue reading on zarar.dev
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.