Create a new function - postgres docs
Arguments:
-
function_name[Name] - name of the new function -
function_params[array] - parameters of the new functionEither array of strings or objects. If array of strings, it is interpreted as is, if array of objects:
mode[string] -IN,OUT,INOUT, orVARIADICname[string] - name of argumenttype[string] - datatype of argumentdefault[string] - default value of argument
-
function_options[object] - options:returns[string] - returns clauselanguage[string] - language name of function definitionreplace[boolean] - create or replace functionwindow[boolean] - window functionbehavior[string] -IMMUTABLE,STABLE, orVOLATILEstrict[boolean] -RETURNS NULL/CALLED ON NULL INPUTonNull[string] (deprecated) - alias forstrict, also acceptsNULLorCALLEDparallel[string] -UNSAFE,RESTRICTED, orSAFEcost[number] - estimated execution costrows[number] - estimated number of result rowscomment[string] - comment on function
-
definition[string] - definition of function
Reverse Operation: dropFunction
Drop a function - postgres docs
Arguments:
function_name[Name] - name of the function to dropfunction_params[array] - seedrop_options[object] - options:ifExists[boolean] - drops function only if it existscascade[boolean] - drops also dependent objects
Alter a function - postgres docs
Arguments:
function_name[Name] - name of the function to dropfunction_params[array] - seefunction_options[object] - options:owner[string] - the new owner of the functionwindow[boolean] - window functionbehavior[string] -IMMUTABLE,STABLE, orVOLATILEstrict[boolean] -RETURNS NULL/CALLED ON NULL INPUTonNull[string] (deprecated) - alias forstrict, also acceptsNULLorCALLEDparallel[string] -UNSAFE,RESTRICTED, orSAFEcost[number] - estimated execution costrows[number] - estimated number of result rowscomment[string] - comment on function
Rename a function - postgres docs
Arguments: