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

CREATE OPERATOR CLASS

劉䓄

CREATE OPERATOR CLASS -- 垔幬婔婻桄淉嘩严䌂

臺濘

CREATE OPERATOR CLASS name [ DEFAULT ] FOR TYPE data_type USING index_method AS
  {  OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ RECHECK ]
   | FUNCTION support_number funcname ( argument_type [, ...] )
   | STORAGE storage_type
  } [, ... ]

柟誄

CREATE OPERATOR CLASS 垔幬婔婻桄䔇淉嘩严䌂㔗婔婻淉嘩严䌂垔幬婔䓉䬹垔䔇昄扞䌂傋套嘘婯婔䓉䘵嚘婔蕙嘪䫘㔗淉嘩严䌂弄滯䬹垔䔇淉嘩严埇傖婺認䓉昄扞䌂傋傖埪認䓉䘵嚘桹濘准噙䬹垔䔇蓐謾潡蔙"亡䘖"㔗淉嘩严䌂誻弄滯䘵嚘桹濘婘婺婔婻䘵嚘庖枕锬垔臖淉嘩严䌂䔇施唍襕嘪䫘䔇櫇毕誺䘋㔗欔橬淉嘩严䌂嘪䫘䔇庘昄启淉嘩严鄘媙釂婘录傺淉嘩严䌂幋嬉垔幬㔗

套悩䂍庺庖昇嚟劉庖闼幽淉嘩严䌂儌婘毺垔䔇昇嚟婺录傺㔗劥彍儌婘嘷嬉昇嚟婺录傺㔗婘劯婔婻昇嚟婺䔇婴婻淉嘩严䌂埇傖橬劯湙䔇劉庖嘖垄傸媙釂䫘庯婉劯䔇䘵嚘桹濘㔗

垔幬淉嘩严䌂䔇䫘潙儖潊婺噽欔橬蔙㔗䕞嬉录锹蔙媙釂滇轙亓䫘潙㔗嘩認湙䔇鍊彽滇啹婺婔婻橬閞鵻䔇淉嘩严䌂垔幬嚔螷橉媇単啄意䫔躿嘷溄㔗

CREATE OPERATOR CLASS 斵婉演昖認婻䌂垔幬滇劥寙劆欔橬䘵嚘桹濘驔襕䔇淉嘩严傖埪庘昄幘婉演昖認底淉嘩严启庘昄滇劥嘵潊婔婻躻寙劆䔇镖劽㔗垔幬婔婻劽濘䔇淉嘩严䌂滇䫘潙䔇蘼傂㔗

埗蔄誗33.14诙埡敘崔媇敇㔗

埗昄

name

儖襕录傺䔇淉嘩严䌂䔇劉庖(埇傖䫘昇嚟媞閄)

DEFAULT

臘䴺臖淉嘩严䌂儖潊婺垄䔇昄扞䌂傋䔇䚺䩕淉嘩严䌂㔗凹庯昊婻昄扞䌂傋启螪閞桹嚟蔯蘔橔崔橬婔婻淉嘩严䌂滇䚺䩕䔇㔗

data_type

認婻淉嘩严䌂崇䊖䔇庖枕䔇昄扞䌂傋

index_method

認婻淉嘩严䌂崇䊖䔇䘵嚘桹濘䔇劉庖

strategy_number

婔婻淉嘩严启認婻淉嘩严䌂噿蕫䔇䘵嚘桹濘䔇亡䘖昄

operator_name

婔婻启臖淉嘩严䌂噿蕫䔇淉嘩严䔇劉庖(埇傖䫘昇嚟媞閄)

op_type

婔婻淉嘩严䔇膷噖昄扞䌂傋潡蔙滇 NONE 臘䴺噥䕞潡蔙埿䕞淉嘩严㔗锔婩愙喕婋埇傖䩕䘖膷噖昄扞䌂傋啹婺認婻施唍垄傸启淉嘩严䌂䔇昄扞䌂傋䕩劯㔗

RECHECK

套悩庺䯄闼幽䘵嚘凹認婻淉嘩严滇"橬托蔖䔇"啹溴嘪䫘認婻䘵嚘演䘵䔇臯媙釂麉桄演昖傖媺臕垄傸䩘溼悇轿启溴淉嘩严䕩噿䔇溇傽床埖㔗

support_number

䘵嚘桹濘凹婔婻婯淉嘩严䌂噿蕫䔇庘昄䔇櫇毕誺䘋昄

funcname

婔婻庘昄䔇劉庖(埇傖橬昇嚟媞閄)認婻庘昄滇䘵嚘桹濘凹溴淉嘩严䌂䔇櫇毕誺䘋㔗

argument_types

庘昄埗昄䔇昄扞䌂傋

storage_type

垂鍙庻嗘婘䘵嚘麯䔇昄扞䌂傋㔗锔婩垄启庖枕昄扞䌂傋䕩劯嘖滇婔底䘵嚘桹濘(彄䕞嬉婺溵埻橬 GIN 启 GiST)噕螩垄滇婉劯䔇㔗鍴麂䘵嚘桹濘噕螩嘪䫘婔䓉婉劯䔇䌂傋劥彍媙釂䩕䘖 STORAGE 床埖㔗

OPERATOR, FUNCTION, STORAGE 床埖埇傖毬䙓傂懟釺废庺䯄㔗

濘懟

啹婺䘵嚘橺彽婉婘嘪䫘庘昄嬉演昖噽螪閞橺彽婘淉嘩严䌂婺寙劆淉嘩严潡蔙庘昄京備庯毽溄䂍欔橬庺欓臯溄鍊㔗認凹庯闼底䫘庯淉嘩严䌂䔇庘昄锔婩婉嚔凚躘傔幽閞鵻㔗

淉嘩严婉庫臖䫘 SQL 庘昄垔幬㔗婔婻 SQL 庘昄冽埇脘滇喙蕫彄脄䫘垄䔇昖臵麯麵認湙儖黂溵嚻寡単臖彆認婻昖臵滇劥埇傖嘪䫘䘵嚘㔗

冋床

婋麵䔇冋床变傴婺昄扞䌂傋 _int4(int4 昄䂇)垔幬庖婔婻 GiST 䘵嚘淉嘩严䌂㔗埗黙 contrib/intarray/ 诙埡垯昘䔇冋床㔗

CREATE OPERATOR CLASS gist__int_ops
    DEFAULT FOR TYPE _int4 USING gist AS
        OPERATOR        3       &&,
        OPERATOR        6       =       RECHECK,
        OPERATOR        7       @>,
        OPERATOR        8       <@,
        OPERATOR        20      @@ (_int4, query_int),
        FUNCTION        1       g_int_consistent (internal, _int4, int4),
        FUNCTION        2       g_int_union (bytea, internal),
        FUNCTION        3       g_int_compress (internal),
        FUNCTION        4       g_int_decompress (internal),
        FUNCTION        5       g_int_penalty (internal, internal, internal),
        FUNCTION        6       g_int_picksplit (internal, internal),
        FUNCTION        7       g_int_same (_int4, _int4, internal);

噚垹攓

CREATE OPERATOR CLASS 滇婔婻 PostgreSQL 欷匘㔗婘 SQL 湺庖婺澇橬認婻臺埖㔗

埽蓕

ALTER OPERATOR CLASS, DROP OPERATOR CLASS

劯锔饡釕嬉誕
CREATE OPERATOR婪婔亓CREATE ROLE