Reputation: 35
I'm new to Postgres (worked with Oracle the last 23 years). I would like to grant the usage on schema to role. But that seems to be impossible:
ps >create role marco_role;
CREATE ROLE
ps >create schema myschema;
CREATE SCHEMA
ps >grant usage on myschema to marco_role;
FEHLER: Relation »myschema« existiert nicht (English: Relation does not exists)
What is my problem?
Upvotes: 1
Views: 4558
Reputation:
To grant privileges on a schema you need to use ON SCHEMA
as documented in the manual
grant usage ON SCHEMA myschema to marco_role;
You probably also want to define default privileges for new tables (that are not yet created) as well:
alter default privileges
in schema myschema
grant select on tables to marco_role;
Upvotes: 2