YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Scene Application Examples
Federal Query
Maintenance and Monitoring
Global Maintenance
Partition Maintenance
Backup and Restore
Cluster Expansion
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
Modify the definition of the function.
ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
action [, ... ] [RESTRICT]
ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
RENAME TO new_name
ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
OWNER TO new_owner
ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
SET SCHEMA new_schema
Where action is:
{CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT}
{IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF}
{[EXTERNAL] SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER}
EXECUTE ON { ANY | MASTER | ALL SEGMENTS | INITPLAN }
COST execution_cost
SET configuration_parameter { TO | = } { value | DEFAULT }
SET configuration_parameter FROM CURRENT
RESET configuration_parameter
RESET ALL
ALTER FUNCTION Modify the definition of the function.
You must be the owner of the function to use ALTER FUNCTION. In order to modify the function's mode, you must also have CREATE permissions in the new mode. In order to modify the owner, you must also be a direct or indirect member of the new role, and that role must have CREATE permissions in the function mode. These restrictions enforce changes to the owner will not do anything you can't do by deleting and recreating the function, however, superusers can change ownership of any function anyway.
name
argmode
argname
argtype
new_name
new_owner
new_schema
CALLED ON NULL INPUT
RETURNS NULL ON NULL INPUT
STRICT
IMMUTABLE
STABLE
VOLATILE
[ EXTERNAL ] SECURITY INVOKER
[ EXTERNAL ] SECURITY DEFINER
LEAKPROOF
EXECUTE ON ANY
EXECUTE ON MASTER
EXECUTE ON ALL SEGMENTS
EXECUTE ON INITPLAN
COST execution_cost
configuration_parameter
value
RESTRICT
The YMatrix database has restrictions such as STABLE or VOLATILE for certain defined functions. See CREATE FUNCTION for more information.
Rename function sqrt of type integer to square_root:
ALTER FUNCTION sqrt(integer) RENAME TO square_root;
Change the owner of the sqrt function of integer type to joe
ALTER FUNCTION sqrt(integer) OWNER TO joe;
Change the mode of function sqrt of type integer to math:
ALTER FUNCTION sqrt(integer) SET SCHEMA math;
To adjust the automatic search path of a function:
ALTER FUNCTION check_password(text) RESET search_path;
This statement is partially compatible with the ALTER FUNCTION statement in the SQL standard. This standard allows modifying more properties of a function, but does not provide functions such as renaming a function, marking a function as a security definer, attaching configuration parameter values to a function, or changing the owner, pattern, or stability of a function. This standard also requires the RESTRICT keyword, which is optional in the YMatrix database.