GRANT (Procedure)
Grants procedure privileges to users and roles. To grant privileges to a schema containing the procedure, users must have USAGE privileges on the schema (see GRANT (Schema).
External procedures that you create with CREATE PROCEDURE are always run with Linux dbadmin privileges. If a dbadmin or pseudosuperuser grants a non-dbadmin permission to run a procedure using GRANT (Procedure), be aware that the non-dbadmin user runs the procedure with full Linux dbadmin privileges.
Syntax
GRANT privilege ON PROCEDURE [[database.]schema.]procedure( [argument-list] )[,…] 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. |
procedure
|
The target procedure. |
| argument-list |
A comma-delimited list of procedure arguments, where each argument is specified as follows: [ argname ] argtype If the procedure is defined with no arguments, supply an empty argument list. |
| 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
Example
The following command grants EXECUTE privileges on the tokenize procedure to users Bob and Jules, and to the Operator role:
=> GRANT EXECUTE ON PROCEDURE tokenize(varchar) TO Bob, Jules, Operator;