Skip to content

ON SCHEMA

Syntax

GRANT { { CREATE | USAGE } [, ...] | ALL [ PRIVILEGES ] }
   ON SCHEMA schema_name [, ...]
   TO role_specification [, ...] [ WITH GRANT OPTION ]

Parameters

ON SCHEMA
Grant privileges on a schema in a database. You can use one statement to grant privileges on several schemas.
CREATE
Privilege to create new tables and views in that schema. To rename an object, you must both own the object and have CREATE privilege for the schema that contains the object.
USAGE
Privilege to access objects in the specified schema (assuming that privileges specific to those objects are met). This privilege allows the role to see objects within the schema, but does not grant SELECT on the tables in the schema. See also Granting Schema-Level Privileges to Members of a Role.

Examples

Grant CREATE and USAGE privileges on schema jbdb to two users:

premdb=# grant all privileges on schema jbdb to yb007,yb008;
GRANT

Grant USAGE privileges on schema jbdb to the role bar:

premdb=# grant usage on schema jbdb to bar;
GRANT

See also Granting Schema-Level Privileges to Members of a Role.

Parent topic:GRANT