DROP PROCEDURE
Removes a procedure.
Please use DPS clusters to run this command. Hybrid DPS does not support it.
Syntax
DROP PROCEDURE [IF EXISTS] <name> ( [ [arg_mode] [arg_name] arg_type [, ...] ] )
[CASCADE | RESTRICT]
Description
Relyt allows you to create namesake procedures with different arguments. Therefore, to run this command, you must specify the argument types.
Only the owner of a procedure can drop the procedure.
Parameters
-
IF EXISTS
If you include
IF EXISTS
in your command, no error will be reported when the specified procedure does not exist. A notice will be issued instead. -
<name>
The name of the procedure. You can prefix the name with a schema name to drop the procedure from the specified schema.
-
<arg_mode>
The mode of the argument, which can be
IN
orVARIADIC
. If omitted, the default valueIN
will be used. -
<arg_name>
The name of the argument.
DROP PROCEDURE
does not use argument names to identify the procedure. -
<arg_type>
The data type of the argument.
-
CASCADE
orRESTRICT
Whether to drop the procedure and its dependent objects if dependent objects exit. Supported options include:
CASCADE
: specifies to drop the depending objects along with the procedure.RESTRICT
: specifies to reject the drop operation and is the default.
Examples
Drop procedure add_films()
:
DROP PROCEDURE add_films();
SQL standard compatibility
DROP PROCEDURE
in Relyt provides the following extensions, compared to DROP PROCEDURE
in the SQL standard:
- Allows you to drop more than one policy in one command.
- Allows you to use the
IF EXISTS
option. - Allows you to specify argument modes and names.