alter_function.7
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 139 行
7
139 行
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "ALTER FUNCTION" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMEALTER FUNCTION \- change the definition of a function.SH SYNOPSIS.sp.nfALTER FUNCTION \fIname\fR ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, ...] ] ) \fIaction\fR [, ... ] [ RESTRICT ]ALTER FUNCTION \fIname\fR ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, ...] ] ) RENAME TO \fInew_name\fRALTER FUNCTION \fIname\fR ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, ...] ] ) OWNER TO \fInew_owner\fRALTER FUNCTION \fIname\fR ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, ...] ] ) SET SCHEMA \fInew_schema\fRwhere \fIaction\fR is one of: CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT IMMUTABLE | STABLE | VOLATILE [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER.sp.fi.SH "DESCRIPTION".PP\fBALTER FUNCTION\fR changes the definition of afunction..PPYou must own the function to use \fBALTER FUNCTION\fR.To change a function's schema, you must also have CREATEprivilege on the new schema.To alter the owner, you must also be a direct or indirect member of the newowning role, and that role must have CREATE privilege onthe function's schema. (These restrictions enforce that altering the ownerdoesn't do anything you couldn't do by dropping and recreating the function.However, a superuser can alter ownership of any function anyway.).SH "PARAMETERS".TP\fB\fIname\fB\fRThe name (optionally schema-qualified) of an existing function..TP\fB\fIargmode\fB\fRThe mode of an argument: either IN, OUT,or INOUT. If omitted, the default is IN.Note that \fBALTER FUNCTION\fR does not actually payany attention to OUT arguments, since only the inputarguments are needed to determine the function's identity.So it is sufficient to list the IN and INOUTarguments..TP\fB\fIargname\fB\fRThe name of an argument.Note that \fBALTER FUNCTION\fR does not actually payany attention to argument names, since only the argument datatypes are needed to determine the function's identity..TP\fB\fIargtype\fB\fRThe data type(s) of the function's arguments (optionally schema-qualified), if any..TP\fB\fInew_name\fB\fRThe new name of the function..TP\fB\fInew_owner\fB\fRThe new owner of the function. Note that if the function ismarked SECURITY DEFINER, it will subsequentlyexecute as the new owner..TP\fB\fInew_schema\fB\fRThe new schema for the function..TP\fBCALLED ON NULL INPUT\fR.TP\fBRETURNS NULL ON NULL INPUT\fR.TP\fBSTRICT\fRCALLED ON NULL INPUT changes the function sothat it will be invoked when some or all of its arguments arenull. RETURNS NULL ON NULL INPUT orSTRICT changes the function so that it is notinvoked if any of its arguments are null; instead, a null resultis assumed automatically. See CREATE FUNCTION [\fBcreate_function\fR(7)] for more information..TP\fBIMMUTABLE\fR.TP\fBSTABLE\fR.TP\fBVOLATILE\fRChange the volatility of the function to the specified setting.See CREATE FUNCTION [\fBcreate_function\fR(7)] for details..TP\fB[ EXTERNAL ] SECURITY INVOKER\fR.TP\fB[ EXTERNAL ] SECURITY DEFINER\fRChange whether the function is a security definer or not. Thekey word EXTERNAL is ignored for SQLconformance. See CREATE FUNCTION [\fBcreate_function\fR(7)] for more information aboutthis capability..TP\fBRESTRICT\fRIgnored for conformance with the SQL standard..SH "EXAMPLES".PPTo rename the function sqrt for type\fBinteger\fR to square_root:.sp.nfALTER FUNCTION sqrt(integer) RENAME TO square_root;.sp.fi.PPTo change the owner of the function sqrt for type\fBinteger\fR to joe:.sp.nfALTER FUNCTION sqrt(integer) OWNER TO joe;.sp.fi.PPTo change the schema of the function sqrt for type\fBinteger\fR to maths:.sp.nfALTER FUNCTION sqrt(integer) SET SCHEMA maths;.sp.fi.SH "COMPATIBILITY".PPThis statement is partially compatible with the \fBALTERFUNCTION\fR statement in the SQL standard. The standard allows moreproperties of a function to be modified, but does not provide theability to rename a function, make a function a security definer,or change the owner, schema, or volatility of a function. The standard alsorequires the RESTRICT key word, which is optional inPostgreSQL..SH "SEE ALSO"CREATE FUNCTION [\fBcreate_function\fR(7)], DROP FUNCTION [\fBdrop_function\fR(l)]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?