I'm trying to create a Postgres database for the first time. So this is probably a stupid question.
I assigned basic read-only permissions to the DB role that must access the database from my PHP scripts, and I have a curiosity: If I execute
GRANT some_or_all_privileges ON ALL TABLES IN SCHEMA schema TO role;
is there any need to also execute this?
GRANT USAGE ON SCHEMA schema TO role;
From the documentation:
USAGE: For schemas, allows access to objects contained in the specified schema (assuming that the objects' own privilege requirements are also met). Essentially this allows the grantee to "look up" objects within the schema.
I think that if I can select or manipulate any data contained in the schema, I can access to any objects of the schema itself. Am I wrong? If not, what is GRANT USAGE ON SCHEMA used for? And what does the documentation mean exactly with "assuming that the objects' own privilege requirements are also met"?