GRANT (library)
Grants privileges on one or more libraries to users and roles.
For example, when working with the Connector Framework Service, you might need to grant a user usage privileges to a library to be able to set UDSession parameters. For more information see Implementing CFS.
Syntax
GRANT privilege
ON LIBRARY [[database.]schema.]library[,...]
TO grantee[,...]
[ WITH GRANT OPTION ]
Arguments
privilege
- Privilege to grant, one of:
-
USAGE
: Grants access to functions in the specified libraries. -
DROP
: Grants permission to drop libraries that the grantee created. -
ALL [PRIVILEGES] [EXTEND]
: Grants all library privileges that also belong to the grantor. Grantors cannot grant privileges that they themselves lack.
You can qualify
ALL
with two optional keywords:-
PRIVILEGES
conforms with the SQL standard. -
EXTEND
extends the semantics ofALL
to include DROP privileges. An unqualifiedALL
excludes this privilege. This option enables backward compatibility withGRANT ALL
usage in pre-9.2.1 Vertica releases.
Important
To execute functions inside the library, users must also have separateEXECUTE
privileges on them, andUSAGE
privileges on their respective schemas. -
[
database
.]
schema
Database and schema. The default schema is
public
. If you specify a database, it must be the current database.library
- The target library.
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, and also revoke them. For details, see Granting privileges.
Privileges
Non-superusers require USAGE on the schema and one of the following:
-
Owner
-
Privileges grantee given the option (
WITH GRANT OPTION
) of granting privileges to other users or roles.
Examples
Grant USAGE privileges on the MyFunctions
library to Fred
:
=> GRANT USAGE ON LIBRARY MyFunctions TO Fred;