9.14. Fonctions et op�rateurs sur les tableaux

Tableau 9-35 affiche les op�rateurs disponibles pour les types array.

Tableau 9-35. Op�rateurs array

Op�rateurDescriptionExempleR�sultat
= �gal �ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3]t
<> diff�rent deARRAY[1,2,3] <> ARRAY[1,2,4]t
< inf�rieur �ARRAY[1,2,3] < ARRAY[1,2,4]t
> sup�rieur �ARRAY[1,4,3] > ARRAY[1,2,4]t
<= inf�rieur ou �gal �ARRAY[1,2,3] <= ARRAY[1,2,3]t
>= sup�rieur ou �gal �ARRAY[1,4,3] >= ARRAY[1,4,3]t
|| concat�nation de tableauxARRAY[1,2,3] || ARRAY[4,5,6]{1,2,3,4,5,6}
|| concat�nation de tableauxARRAY[1,2,3] || ARRAY[[4,5,6],[7,8,9]]{{1,2,3},{4,5,6},{7,8,9}}
|| concat�nation d'un �l�ment avec un tableau3 || ARRAY[4,5,6]{3,4,5,6}
|| concat�nation d'un tableau avec un �l�mentARRAY[4,5,6] || 7{4,5,6,7}

Voir Section 8.10 pour plus de d�tails sur le comportement des op�rateurs.

Tableau 9-36 affiche les fonctions disponibles � l'utilisation avec des types tableaux. Voir Section 8.10 pour plus de discussion et d'exemples d'utilisation de ces fonctions.

Tableau 9-36. Fonctions sur array

FonctionType de retourDescriptionExempleR�sultat
array_cat (anyarray, anyarray) anyarrayconcat�ne deux tableauxarray_cat(ARRAY[1,2,3], ARRAY[4,5]){1,2,3,4,5}
array_append (anyarray, anyelement) anyarrayajoute un �l�ment � la fin d'un tableauarray_append(ARRAY[1,2], 3){1,2,3}
array_prepend (anyelement, anyarray) anyarrayajoute un �l�ment au d�but d'un tableauarray_prepend(1, ARRAY[2,3]){1,2,3}
array_dims (anyarray) textrenvoie une repr�sentation textuelle des dimensions d'un tableauarray_dims(array[[1,2,3], [4,5,6]])[1:2][1:3]
array_lower (anyarray, integer) integerrenvoie la dimension inf�rieure du tableau donn�array_lower(array_prepend(0, ARRAY[1,2,3]), 1)0
array_upper (anyarray, integer) integerrenvoie la dimension sup�rieure du tableau donn�array_upper(ARRAY[1,2,3,4], 1)4
array_to_string (anyarray, text) textconcat�ne des �l�ments de tableau en utilisant le d�limiteur fourniarray_to_string(array[1, 2, 3], '~^~')1~^~2~^~3
string_to_array (text, text) text[]divise une cha�ne en tableau d'�l�ments utilisant le d�limiteur fournistring_to_array( 'xx~^~yy~^~zz', '~^~'){xx,yy,zz}