Skip to content

Commit

Permalink
Traductions du jour
Browse files Browse the repository at this point in the history
  • Loading branch information
gleu committed Sep 8, 2023
1 parent 129a1bc commit 1555eb6
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 192 deletions.
42 changes: 22 additions & 20 deletions postgresql/ecpg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ EXEC SQL END DECLARE SECTION;
<title>Typedefs</title>
<indexterm>
<primary>typedef</primary>
<secondary>in ECPG</secondary>
<secondary>en ECPG</secondary>
</indexterm>

<para>
Expand All @@ -1506,39 +1506,41 @@ EXEC SQL END DECLARE SECTION;
<programlisting>
EXEC SQL TYPE serial_t IS long;
</programlisting>
Cette déclaration n'a pas besoin de faire partie d'une section declare;
that is, you can also write typedefs as normal C statements.
Cette déclaration n'a pas besoin de faire partie d'une section
declare&nbsp;; c'est-à-dire que vous pouvez aussi écrire les
typedefs comme des instructions C normales.
</para>

<para>
Any word you declare as a typedef cannot be used as an SQL keyword
in <literal>EXEC SQL</literal> commands later in the same program.
For example, this won't work:
Tout mot que vous déclarez comme un typedef ne peut pas être utilisé
comme un mot-clé SQL dans les commandes <literal>EXEC SQL</literal>
plus tard dans le même programme. Par exemple, ceci ne fonctionnera
pas&nbsp;:
<programlisting>
EXEC SQL BEGIN DECLARE SECTION;
typedef int start;
EXEC SQL END DECLARE SECTION;
...
EXEC SQL START TRANSACTION;
</programlisting>
ECPG will report a syntax error for <literal>START
TRANSACTION</literal>, because it no longer
recognizes <literal>START</literal> as an SQL keyword,
only as a typedef.
(If you have such a conflict, and renaming the typedef
seems impractical, you could write the SQL command
using <link linkend="ecpg-dynamic">dynamic SQL</link>.)
ECPG renverra une erreur de syntaxe pour <literal>START
TRANSACTION</literal> car il ne reconnaît pas
<literal>START</literal> comme un mot-clé SQL, seulement comme un
typedef.
(Si vous avez un tel conflit et que renommer le typedef ne semble
pas pratique, vous pourriez écrire la commande SQL en utilisant le
<link linkend="ecpg-dynamic">SQL dynamique</link>.)
</para>

<note>
<para>
In <productname>PostgreSQL</productname> releases before v16, use
of SQL keywords as typedef names was likely to result in syntax
errors associated with use of the typedef itself, rather than use
of the name as an SQL keyword. The new behavior is less likely to
cause problems when an existing ECPG application is recompiled in
a new <productname>PostgreSQL</productname> release with new
keywords.
Pour les versions de <productname>PostgreSQL</productname> antérieures
à la 16, l'utilisation des mots-clés SQL comme noms de typedef allait
probablement résulter en des erreurs de syntaxe associées à l'utilisation
du typedef, plutôt que d'utiliser le nom d'un mot-clé SQL. Le nouveau
comportement devrait moins poser de problèmes quand une application
ECPG existante est recompilée pour une nouvelle version de
<productname>PostgreSQL</productname> avec de nouveaux mots-clés.
</para>
</note>
</sect4>
Expand Down

0 comments on commit 1555eb6

Please sign in to comment.