PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

ALTER FUNCTION

劉䓄

ALTER 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

認麯䔇 action 滇套婋幋婔

    CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
    IMMUTABLE | STABLE | VOLATILE
    [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER

柟誄

ALTER FUNCTION 媞櫹婔婻庘昄䔇垔幬㔗

襕嘪䫘 ALTER FUNCTION 嘹媙釂拖橬臖庘昄㔗襕媞櫹婔婻庘昄䔇昇嚟嘹誻媙釂婘桄昇嚟婪拖橬 CREATE 溄鍊㔗襕媞櫹欔橬蔙嘹誻媙釂滇桄䔇欔橬蓐謾䔇䕘毖潡閘毖潊叻幽婫臖潊叻媙釂婘溴庘昄䔇昇嚟婪橬 CREATE 溄鍊㔗認底鍊彽嚺彽庖媞櫹臖欔橬蔙婉嚔啔傂嘘锔誺役鍴启麉傺庘昄婉脘啔䔇庋愙㔗婉誺轙亓䫘潙埇傖傖傂嘘桹嚟媞櫹傂懟庘昄䔇欔橬溄㔗

埗昄

name

婔婻䯄橬䔇庘昄劉庖(埇傖橬昇嚟媞閄)

argmode

埗昄䔇昇嚟埇傖滇 IN(䚺䩕), OUT, INOUT 幋婔㔗臙婂懟 ALTER FUNCTION 垂鍙婉嚔濘懟傂嘘 OUT 埗昄啹婺彴桺庘昄䔇躆傘埻驔襕膷噖埗昄㔗啹溴彖庺 ININOUT 埗昄儌轿崘庖㔗

argname

埗昄䔇劉庖㔗臙濘懟 ALTER FUNCTION 垂鍙婪婉嚔濘懟埗昄䔇劉庖啹婺埻橬埗昄䔇昄扞䌂傋䫘庯彴桺庘昄䔇躆傘㔗

argtype

套悩橬䔇臺滇臖庘昄埗昄䔇昄扞䌂傋(埇傖䫘昇嚟媞閄)㔗

new_name

庘昄䔇桄劉庖

new_owner

庘昄䔇桄欔橬蔙㔗臙濘懟套悩庘昄湺螄婺 SECURITY DEFINER 闼幽垄锟劯儖傖桄䔇欔橬蔙欓臯㔗

new_schema

庘昄䔇桄昇嚟

CALLED ON NULL INPUT
RETURNS NULL ON NULL INPUT
STRICT

CALLED ON NULL INPUT 檪庘昄櫹潊婘欔橬埗昄鄘滇 NULL 䔇施唍幘嚔脄䫘垄㔗RETURNS NULL ON NULL INPUTSTRICT 檪庘昄櫹潊套悩傂嘘婔婻埗昄滇 NULL 儌湹橸婉欓臯幽婫躻媘誫啂 NULL 㔗埗黙 CREATE FUNCTION 诙埡敘崔媇敇㔗

IMMUTABLE
STABLE
VOLATILE

檪庘昄䔇滷崌匂攓媞櫹婺毺垔䌂傋㔗埗黙 CREATE FUNCTION 诙埡䂖誗㔗

[EXTERNAL] SECURITY INVOKER
[EXTERNAL] SECURITY DEFINER

媞櫹庘昄䔇垬噘攓垔幬湺臖垄滇劥滇垬噘垔幬単㔗庺庯噚垹 SQL 湺庖噿髞庖 EXTERNAL 儖赆媘䘖㔗埗黙 CREATE FUNCTION 诙埡敘崔橬噿認婻媘脘䔇媇敇㔗

RESTRICT

啹噚垹 SQL 湺庖蔯媘䘖

冋床

檪埗昄䌂傋婺 integer 䔇庘昄 sqrt 麉变劉婺 square_root

ALTER FUNCTION sqrt(integer) RENAME TO square_root;

檪埗昄䌂傋婺 integer 䔇庘昄 sqrt 䔇欔橬蔙媞櫹婺 joe

ALTER FUNCTION sqrt(integer) OWNER TO joe;

檪埗昄䌂傋婺 integer 䔇庘昄 sqrt 䔇昇嚟媞櫹婺 maths

ALTER FUNCTION sqrt(integer) SET SCHEMA maths;

噚垹攓

認婻臺埖鄘彖噚垹 SQL 湺庖麯麵䔇 ALTER FUNCTION 臺埖㔗湺庖噕螩媞櫹庘昄䔇敘崔匂攓嘖滇澇橬柊冕媞櫹庘昄劉庖䔇媘脘幘澇橬柊冕檪婔婻庘昄垔幬婺垬噘垔幬単䔇媘脘敘澇橬媞櫹庘昄欔橬蔙㔕昇嚟㔕滷崌攓䔇媘脘㔗湺庖誻襕挗 RESTRICT 噿髞庖認婘 PostgreSQL 麯滇埇锬䔇㔗

埽蓕

CREATE FUNCTION, DROP FUNCTION

劯锔饡釕嬉誕
ALTER DOMAIN婪婔亓ALTER GROUP