Skip to content

Commit

Permalink
Translate plpython.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
rjuju authored and gleu committed Jun 19, 2017
1 parent ac2533a commit bfc4bcf
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions postgresql/plpython.xml
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,11 @@ SELECT return_arr();
(1 row)
</programlisting>

Multidimensional arrays are passed into PL/Python as nested Python lists.
A 2-dimensional array is a list of lists, for example. When returning
a multi-dimensional SQL array out of a PL/Python function, the inner
lists at each level must all be of the same size. For example:
Les tableaux multi-dimesionnels sont passé dans PL/Python en tant que
listes Python imbriquées. Un tableau à 2 dimensions est une liste de
liste, par exemple. Quand une fonction PL/Python renvoie un tableau SQL
multi-dimensionnel, les listes internes doivent avoir la même taille à
chaque niveau. Par exemple :

<programlisting>
CREATE FUNCTION test_type_conversion_array_int4(x int4[]) RETURNS int4[] AS $$
Expand All @@ -487,13 +488,13 @@ INFO: ([[1, 2, 3], [4, 5, 6]], &lt;type 'list'&gt;)
(1 row)
</programlisting>

Other Python sequences, like tuples, are also accepted for
backwards-compatibility with PostgreSQL versions 9.6 and below, when
multi-dimensional arrays were not supported. However, they are always
treated as one-dimensional arrays, because they are ambiguous with
composite types. For the same reason, when a composite type is used in a
multi-dimensional array, it must be represented by a tuple, rather than a
list.
Les autres séquences Python, comme les tuples, sont également acceptées
pour compatibilité descendante avec les versions 9.6 et inférieures de
PostgreSQL, quand les tableaux multi-dimesionnels n'étaient pas supportés.
Cependant, ils sont toujours traités comme des tableaux à une dimension,
car ils sont ambigus avec les types composites. Pour la même raison, quand
un type composite est utilisé dans un tableau multi-dimensionnel, il doit
être représenté par un tuple, plutôt que par une liste.
</para>

<para>
Expand Down Expand Up @@ -583,9 +584,9 @@ $$ LANGUAGE plpythonu;
position correspondante.
</para>
<para>
When an array of composite types is returned, it cannot be returned as a list,
because it is ambiguous whether the Python list represents a composite type,
or another array dimension.
Quand un tableau de types composites est retourné, il ne peut pas être
retourné comme une liste, car il est ambigu de savoir si la liste
Python représente un type composite ou une autre dimension de tableau.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -1061,8 +1062,8 @@ rv = plpy.execute(plan, ["name"], 5)
</para>

<para>
Alternatively, you can call the <function>execute</function> method on
the plan object:
De manière alternative, vous pouvez appeler la méthode
<function>execute</function> sur l'objet plan :
<programlisting>
rv = plan.execute(["name"], 5)
</programlisting>
Expand Down Expand Up @@ -1105,9 +1106,8 @@ rv = plan.execute(["name"], 5)
et retourne un objet curseur, qui permet de traiter de gros ensembles de
résultats en plus petits morceaux. Comme avec <literal>plpy.execute</literal>,
une chaîne de caractère ou un objet plan accompagné d'une liste d'arguments
peuvent être utilisés, or
the <function>cursor</function> function can be called as a method of
the plan object.
peuvent être utilisés, ou la fonction <function>cursor</function> peut
être appelée comme une méthode de l'objet plan.
</para>

<para>
Expand Down

0 comments on commit bfc4bcf

Please sign in to comment.