ALTER PROCEDURE statement modifies a stored procedure.
Required privileges
Refer to the respective subcommands.Synopsis
Parameters
Subcommands
OWNER TO
ALTER PROCEDURE ... OWNER TO is used to change the owner of a procedure.
Required privileges
- To alter the owner of a procedure, the new owner must have
CREATEprivilege on the schema of the procedure. - To alter a procedure, a user must own the procedure.
- To alter a procedure, a user must have
DROPprivilege on the schema of the procedure.
Parameters
See Synopsis.
RENAME TO
ALTER PROCEDURE ... RENAME TO changes the name of a procedure.
Required privileges
- To alter a procedure, a user must own the procedure.
- To alter a procedure, a user must have
DROPprivilege on the schema of the procedure.
Parameters
See Synopsis.
SET SCHEMA
ALTER PROCEDURE ... SET SCHEMA changes the schema of a procedure.
CockroachDB supports
SET SCHEMA as an alias for setting the search_path session variable.Required privileges
- To change the schema of a procedure, a user must have
CREATEprivilege on the new schema. - To alter a procedure, a user must own the procedure.
- To alter a procedure, a user must have
DROPprivilege on the schema of the procedure.
Parameters
See Synopsis.
Examples
Rename a stored procedure
The following statement renames thedelete_earliest_histories example procedure to delete_histories:

