臘9-35滆䴺庖埇傖䫘庯 array 䌂傋䔇淉嘩严㔗
臘9-35. array 淉嘩严
淉嘩严 | 柟誄 | 冋床 | 䂷悩 |
---|---|---|---|
= | 京庯 | ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3] | t |
<> | 婉京庯 | ARRAY[1,2,3] <> ARRAY[1,2,4] | t |
< | 償庯 | ARRAY[1,2,3] < ARRAY[1,2,4] | t |
> | 崓庯 | ARRAY[1,4,3] > ARRAY[1,2,4] | t |
<= | 償庯潡京庯 | ARRAY[1,2,3] <= ARRAY[1,2,3] | t |
>= | 崓庯潡京庯 | ARRAY[1,4,3] >= ARRAY[1,4,3] | t |
@> | 寙劆 | ARRAY[1,4,3] @> ARRAY[3,1] | t |
<@ | 赆寙劆庯 | ARRAY[2,7] <@ ARRAY[1,7,4,2,6] | t |
&& | 麉培(橬噌劯噄䘹) | ARRAY[1,4,3] && ARRAY[2,1] | t |
|| | 昄䂇婯昄䂇誂毖 | ARRAY[1,2,3] || ARRAY[4,5,6] | {1,2,3,4,5,6} |
|| | 昄䂇婯昄䂇誂毖 | ARRAY[1,2,3] || ARRAY[[4,5,6],[7,8,9]] | {{1,2,3},{4,5,6},{7,8,9}} |
|| | 噄䘹婯昄䂇誂毖 | 3 || ARRAY[4,5,6] | {3,4,5,6} |
|| | 昄䂇婯噄䘹誂毖 | ARRAY[4,5,6] || 7 | {4,5,6,7} |
昄䂇懫膄滇嘪䫘邻螴䔇 B-Tree 懫膄庘昄凹欔橬噄䘹锊婔誕臯懫膄䔇㔗崔䂘昄䂇䔇噄䘹毬䙓臯釺废誕臯螪閞(橔劯䔇婋湺埻寡橔媆)㔗套悩婴婻昄䂇䔇喙垹䕩劯嘖䂘昄婉京闼幽喿垔毐废釺废䔇饡襕啹䘹儖滇䂘昄(寘桺the first difference in the dimensionality information determines the sort order)認婯 PostgreSQL 8.2 幋嬉䔇䬽橸婉劯蔕䬽橸螴婺喙垹䕩劯䔇婴婻昄䂇䕩京剿嘪垄傸䔇䂘昄潡婋湺评啘幽婉䕩劯㔗
埗黙誗8.10诙埡橬噿昄䂇淉嘩严臯婺䔇敘崔䂖誗㔗
臘9-36滆䴺庖埇傖䫘庯昄䂇䌂傋䔇庘昄㔗埗黙誗8.10诙埡敘崔媇敇傖埪嘪䫘認底庘昄䔇冋床㔗
臘9-36. array 庘昄
庘昄 | 誫啂䌂傋 | 柟誄 | 冋床 | 䂷悩 |
---|---|---|---|---|
array_append (anyarray, anyelement) | anyarray | 劏昄䂇橆儆時媹噄䘹 | array_append(ARRAY[1,2], 3) | {1,2,3} |
array_cat (anyarray, anyarray) | anyarray | 誂毖婴婻昄䂇 | array_cat(ARRAY[1,2,3], ARRAY[4,5]) | {1,2,3,4,5} |
array_dims (anyarray) | text | 誫啂昄䂇䂘昄䔇桺橸臘䴺 | array_dims(ARRAY[[1,2,3], [4,5,6]]) | [1:2][1:3] |
array_lower (anyarray, int) | int | 誫啂昄䂇䂘昄䔇婋䘯 | array_lower('[0:2]={1,2,3}'::int[], 1) | 0 |
array_prepend (anyelement, anyarray) | anyarray | 劏昄䂇嚔崘時媹噄䘹 | array_prepend(1, ARRAY[2,3]) | {1,2,3} |
array_to_string (anyarray, text) | text | 嘪䫘彖锫严儖昄䂇噄䘹誂毖婺庖严婾 | array_to_string(ARRAY[1, 2, 3], '~^~') | 1~^~2~^~3 |
array_upper (anyarray, int) | int | 誫啂昄䂇䂘昄䔇婪䘯 | array_upper(ARRAY[1,2,3,4], 1) | 4 |
string_to_array (text, text) | text[] | 嘪䫘毺垔䔇彖锫严檪庖严婾彖輗潊昄䂇噄䘹 | string_to_array('xx~^~yy~^~zz', '~^~') | {xx,yy,zz} |