Skip to content

Commit

Permalink
3 fichiers de traduit
Browse files Browse the repository at this point in the history
  • Loading branch information
gleu committed Sep 11, 2018
1 parent 4637264 commit 7f96704
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 151 deletions.
117 changes: 59 additions & 58 deletions postgresql/plpgsql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@
aussi accepter ou renvoyer n'importe quel type composite (type ligne) spécifié
par nom. Il est aussi possible de déclarer une fonction
<application>PL/pgSQL</application> renvoyant un type <type>record</type>,
which means that any composite type will do as input, or as returning
<type>record</type>
signifiant que le résultat est un type ligne dont les colonnes sont déterminées
par spécification dans la requête appelante (voir la
<xref linkend="queries-tablefunctions"/>).
ce qui signifie que n'importe quel type composé conviendra, ou comme
renvoyant <type>record</type> signifiant que le résultat est un type ligne
dont les colonnes sont déterminées par spécification dans la requête
appelante (voir la <xref linkend="queries-tablefunctions"/>).
</para>

<para>
Expand All @@ -168,9 +167,9 @@
</para>

<para>
Enfin, une fonction <application>PL/pgSQL</application> peut être déclarée comme renvoyant
<type>void</type> si elle n'a pas de valeur de retour utile. (Alternatively, it
could be written as a procedure in that case.)
Enfin, une fonction <application>PL/pgSQL</application> peut être déclarée
comme renvoyant <type>void</type> si elle n'a pas de valeur de retour
utile. (Il est possible de l'écrire comme une procédure dans ce cas.)
</para>

<para>
Expand Down Expand Up @@ -1882,19 +1881,20 @@ SELECT * FROM obtient_idvol_disponibles(CURRENT_DATE);
</sect2>

<sect2 id="plpgsql-statements-returning-procedure">
<title>Returning From a Procedure</title>
<title>Retour d'une procédure</title>

<para>
A procedure does not have a return value. A procedure can therefore end
without a <command>RETURN</command> statement. If
a <command>RETURN</command> statement is desired to exit the code early,
then <symbol>NULL</symbol> must be returned. Returning any other value
will result in an error.
Une procédure n'a pas de valeur de retour. De ce fait, une procédure peut
se terminer sans instruction <command>RETURN</command>. Si une
instruction <command>RETURN</command> doit quitter le code en avance,
alors la valeur <symbol>NULL</symbol> doit être renvoyée. Renvoyer tout
autre valeur résultera en une erreur.
</para>

<para>
If a procedure has output parameters, then the output values can be
assigned to the parameters as if they were variables. For example:
Si une procédure a des paramètres en sortie, alors les valeurs en sortie
peuvent être affectées aux paramètres comme s'il s'agissait de variables.
Par exemple&nbsp;:
<programlisting>
CREATE PROCEDURE triple(INOUT x int)
LANGUAGE plpgsql
Expand Down Expand Up @@ -3208,14 +3208,13 @@ BEGIN
<literal>FORWARD</literal> ou
<literal>BACKWARD</literal>.
Omettre <replaceable>direction</replaceable> est identique à spécifier
<literal>NEXT</literal>.
In the forms using a <replaceable>count</replaceable>,
the <replaceable>count</replaceable> can be any integer-valued
expression (unlike the SQL <command>FETCH</command> command,
which only allows an integer constant).
Les valeurs <replaceable>direction</replaceable>
qui nécessitent d'aller en sens inverse risquent d'échouer sauf si le
curseur a été déclaré ou ouvert avec l'option <literal>SCROLL</literal>.
<literal>NEXT</literal>. Quand la syntaxe utilise un
<replaceable>count</replaceable>, le <replaceable>count</replaceable> peut
être une expression de type integer (contrairement à la commande SQL
<command>FETCH</command>, qui autorise seulement une constante de type
integer). Les valeurs <replaceable>direction</replaceable> qui nécessitent
d'aller en sens inverse risquent d'échouer sauf si le curseur a été
déclaré ou ouvert avec l'option <literal>SCROLL</literal>.
</para>

<para>
Expand Down Expand Up @@ -3455,21 +3454,21 @@ END LOOP <optional> <replaceable>label</replaceable> </optional>;
</sect1>

<sect1 id="plpgsql-transactions">
<title>Transaction Management</title>
<title>Gestion des transactions</title>

<para>
In procedures invoked by the <command>CALL</command> command
as well as in anonymous code blocks (<command>DO</command> command),
it is possible to end transactions using the
commands <command>COMMIT</command> and <command>ROLLBACK</command>. A new
transaction is started automatically after a transaction is ended using
these commands, so there is no separate <command>START
TRANSACTION</command> command. (Note that <command>BEGIN</command> and
<command>END</command> have different meanings in PL/pgSQL.)
Dans les procédures appelées par la commande <command>CALL</command> ainsi
que dans les blocs de code anonymes (commande <command>DO</command>), il
est possible de terminer les transactions en utilisant les commandes
<command>COMMIT</command> et <command>ROLLBACK</command>. Une nouvelle
transaction est démarrée automatiquement après qu'une transaction ait été
terminée en utilisant ces commandes, donc il n'existe pas de commande
<command>START TRANSACTION</command>. (Notez que <command>BEGIN</command>
et <command>END</command> ont une signification différente dans PL/pgSQL.)
</para>

<para>
Here is a simple example:
Voici un exemple simple&nbsp;:
<programlisting>
CREATE PROCEDURE transaction_test1()
LANGUAGE plpgsql
Expand All @@ -3491,21 +3490,22 @@ CALL transaction_test1();
</para>

<para>
Transaction control is only possible in <command>CALL</command> or
<command>DO</command> invocations from the top level or nested
<command>CALL</command> or <command>DO</command> invocations without any
other intervening command. For example, if the call stack is
<command>CALL proc1()</command> &rarr; <command>CALL proc2()</command>
&rarr; <command>CALL proc3()</command>, then the second and third
procedures can perform transaction control actions. But if the call stack
is <command>CALL proc1()</command> &rarr; <command>SELECT
func2()</command> &rarr; <command>CALL proc3()</command>, then the last
procedure cannot do transaction control, because of the
<command>SELECT</command> in between.
Le contrôle des transactions est seulement possible dans les appels à
<command>CALL</command> et <command>DO</command> à partir du plus haut
niveau ou dans les appels imbriqués à <command>CALL</command> ou
<command>DO</command> sans autre commande. Par exemple, si la pile d'appel
est <command>CALL proc1()</command> &rarr; <command>CALL proc2()</command>
&rarr; <command>CALL proc3()</command>, alors la deuxième et la troisième
procédures peuvent exécuter les actions de contrôle de transaction. Mais
si la pile d'appel est <command>CALL proc1()</command> &rarr;
<command>SELECT func2()</command> &rarr; <command>CALL proc3()</command>,
alors la dernière procédure ne peut pas faire de contrôle de transactions
à cause du <command>SELECT</command>.
</para>

<para>
Special considerations apply to cursor loops. Consider this example:
Des considérations spéciales s'appliquent aux boucles de curseur.
Considérez cet exemple&nbsp;:
<programlisting>
CREATE PROCEDURE transaction_test2()
LANGUAGE plpgsql
Expand All @@ -3522,24 +3522,25 @@ $$;

CALL transaction_test2();
</programlisting>
Normally, cursors are automatically closed at transaction commit.
However, a cursor created as part of a loop like this is automatically
converted to a holdable cursor by the first <command>COMMIT</command> or
<command>ROLLBACK</command>. That means that the cursor is fully
evaluated at the first <command>COMMIT</command> or
<command>ROLLBACK</command> rather than row by row. The cursor is still
removed automatically after the loop, so this is mostly invisible to the
user.
Habituellement, les curseurs sont automatiquement fermés au moment de la
validation de la transaction. Néanmoins, un curseur créé dans une boucle
comme celle-ci est automatiquement converti en un curseur maintenable par
le premier <command>COMMIT</command> ou <command>ROLLBACK</command>. Ceci
signifie que le curseur est complètement évalué au premier
<command>COMMIT</command> ou <command>ROLLBACK</command> plutôt que ligne
par ligne. Le curseur est toujours automatiquement supprimé après la
boucle, donc c'est pratiquement invisible pour l'utilisateur.
</para>

<para>
Transaction commands are not allowed in cursor loops driven by commands
that are not read-only (for example <command>UPDATE
... RETURNING</command>).
Les commandes de transaction ne sont pas autorisées dans les boucles de
curseur exécutés par des commandes qui ne sont pas en lecture seule (par
exemple <command>UPDATE ... RETURNING</command>).
</para>

<para>
A transaction cannot be ended inside a block with exception handlers.
Une transaction ne peut pas être terminée dans un bloc contenant un gestionnaire
d'exceptions.
</para>
</sect1>

Expand Down

0 comments on commit 7f96704

Please sign in to comment.