DROP FUNCTION
Function Description
Delete the external function under the current or specified schema. It should be noted that once a function is deleted, it cannot be recovered and can only be recreated. Additionally, deleting a function does not clean up the function code and executable files stored in object storage.
Syntax
Parameter Description
<function_name>
: The specified external function name.IF EXISTS
: Optional parameter to check if the function exists. If it exists, the function is deleted; if it does not exist, no action is taken.CASCADE
: Optional parameter to delete the function and all its dependent objects.RESTRICT
: Optional parameter that, if set, only allows the function to be deleted if no other objects depend on it.
Usage Instructions
- When deleting a function, it is recommended to use the
IF EXISTS
parameter first to avoid errors caused by the function not existing. - When deleting a function, ensure that no other objects depend on the function. If there are dependencies, you can use the
CASCADE
parameter to delete all dependent objects, or delete the dependent objects first, and then delete the function. - After deleting the function, you need to recreate the function and reload the function code and executable files.
Example
- Delete the external function named
ext_to_upper
.
- Delete the external function named
ext_get_user_info
if it exists.
-
Delete the external function named
ext_sum_values
if it exists and has other objects dependent on it, but do not delete the dependent objects. -
删除名为
ext_sum_values
的外部函数,如果该函数存在且有其他对象依赖,但不删除依赖对象。