GRANT (View)
Grants view privileges to users and roles.
Syntax
GRANT privilege ON [[database.]schema.]view[,…] TO grantee[,…] [ WITH GRANT OPTION ]
Parameters
| privilege |
One of the following:
|
[database.]schema
|
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
| view |
The target view. |
| view |
The target view. |
| grantee |
Specifies who is granted privileges, one of the following: |
WITH GRANT OPTION
|
Gives grantee the privilege to grant the same privileges to other users or roles. For details, see How to Grant Privileges in the Administrator's Guide. |
Privileges
One of the following:
- Superuser
- Privileges grantee who was given the option (
WITH GRANT OPTION) of extending these privileges to other users
Examples
Grant user Joe all privileges on view ship.
=> CREATE VIEW ship AS SELECT * FROM public.shipping_dimension; CREATE VIEW
=> GRANT ALL PRIVILEGES ON ship TO Joe; GRANT PRIVILEGE