Skip to content

Commit

Permalink
Traductions du week-end
Browse files Browse the repository at this point in the history
  • Loading branch information
gleu committed Jun 5, 2016
1 parent c16fdf9 commit 8c9a061
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 249 deletions.
108 changes: 56 additions & 52 deletions postgresql/bgworker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ typedef struct BackgroundWorker
<listitem>
<para>
<indexterm><primary>BGWORKER_SHMEM_ACCESS</primary></indexterm>
Requests shared memory access. Workers without shared memory access
cannot access any of <productname>PostgreSQL's</productname> shared
data structures, such as heavyweight or lightweight locks, shared
buffers, or any custom data structures which the worker itself may
wish to create and use.
Réclame un accès à la mémoire partagée. Les processus sans accès à la
mémoire partagée ne peuvent pas accéder aux structures de données
partagées de <productname>PostgreSQL</productname>, tels que les verrous
(lourds ou légers), la mémoire partagée et toute structure de données
personnalisée que le processus pourrait vouloir créer et utiliser.
</para>
</listitem>
</varlistentry>
Expand All @@ -94,11 +94,13 @@ typedef struct BackgroundWorker
<listitem>
<para>
<indexterm><primary>BGWORKER_BACKEND_DATABASE_CONNECTION</primary></indexterm>
Requests the ability to establish a database connection through which it
can later run transactions and queries. A background worker using
<literal>BGWORKER_BACKEND_DATABASE_CONNECTION</literal> to connect to a
database must also attach shared memory using
<literal>BGWORKER_SHMEM_ACCESS</literal>, or worker start-up will fail.
Réclame la capacité à établir une connexion à une base à partir de
laquelle il peut ensuite exécuter des transactions et des requêtes. Un
processus en tâche de fond utilisant
<literal>BGWORKER_BACKEND_DATABASE_CONNECTION</literal> pour se connecter
à une base doit aussi s'attacher à la mémoire partagée en utilisant
<literal>BGWORKER_SHMEM_ACCESS</literal>. Dans le cas contraire, son
démarrage échouera.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -133,27 +135,28 @@ typedef struct BackgroundWorker

<para>
<structfield>bgw_main</structfield> est un pointeur vers la fonction à lancer
quand le processus est démarré.
This field can only safely be used to launch
functions within the core server, because shared libraries may be loaded
at different starting addresses in different backend processes. This will
happen on all platforms when the library is loaded using any mechanism
other than <xref linkend="guc-shared-preload-libraries"/>. Even when that
mechanism is used, address space layout variations will still occur on
Windows, and when <literal>EXEC_BACKEND</literal> is used. Therefore, most users
of this API should set this field to NULL. If it is non-NULL, it takes
precedence over <structfield>bgw_library_name</structfield> and
quand le processus est démarré. Ce champ peut seulement être utilisé de façon
sûre pour lancer des fonctions au niveau du moteur car les bibliothèques
partagées pourraient être chargées à des adresses différentes pour les
différents processus. Ceci arrivera sur toutes les plateformes quand la
bibliothèque est chargée en utilisant tout mécanisme autre que <xref
linkend="guc-shared-preload-libraries"/>. Même quand ce mécanisme est
utilisé, les variations de disposition des espaces d'adressage interviendront
toujours sur Windows et quand <literal>EXEC_BACKEND</literal> est utilisé.
De ce fait, la plupart des utilisateurs de cette API configurera ce champ
à NULL. S'il n'est pas NULL, il est prioritaire à
<structfield>bgw_library_name</structfield> et
<structfield>bgw_function_name</structfield>.
</para>

<para>
<structfield>bgw_library_name</structfield> est le nom d'une bibliothèque
dans laquelle le point d'entrée initial pour le processus en tâche de fond
devrait être recherché.
The named library will be dynamically loaded by the worker process and
<structfield>bgw_function_name</structfield> will be used to identify the
function to be called. If loading a function from the core code,
<structfield>bgw_main</structfield> should be set instead.
devrait être recherché. La bibliothèque nommée sera chargée dynamiquement
par le processus en tâche de fond et <structfield>bgw_function_name</structfield>
sera utiliser pour identifier la fonction à appeler. S'il charge une fonction
du code du moteur, il faudrait plutôt configurer
<structfield>bgw_main</structfield>.
</para>

<para>
Expand All @@ -163,27 +166,28 @@ typedef struct BackgroundWorker
</para>

<para>
<structfield>bgw_main_arg</structfield> is the <type>Datum</type> argument
to the background worker main function. Regardless of whether that
function is specified via <structfield>bgw_main</structfield> or via the combination
of <function>bgw_library_name</function> and <function>bgw_function_name</function>,
this main function should take a single argument of type <type>Datum</type>
and return <type>void</type>. <structfield>bgw_main_arg</structfield> will be
passed as the argument. In addition, the global variable
<literal>MyBgworkerEntry</literal>
points to a copy of the <structname>BackgroundWorker</structname> structure
passed at registration time; the worker may find it helpful to examine
this structure.
<structfield>bgw_main_arg</structfield> est l'argument <type>Datum</type> de
la fonction principale du processus. Que cette fonction soit spécifiée ou
non via <structfield>bgw_main</structfield> ou via la combinaison de
<function>bgw_library_name</function> et <function>bgw_function_name</function>,
cette fonction principale devrait prendre un seul argument de type
<type>Datum</type> et renvoyer <type>void</type>.
<structfield>bgw_main_arg</structfield> sera passé comme argument. De plus,
la variable globale <literal>MyBgworkerEntry</literal> pointe vers une copie
de la structure <structname>BackgroundWorker</structname> passé au moment de
l'enregistrement&nbsp;; le processus pourrait trouver utile d'examiner cette
structure.
</para>

<para>
On Windows (and anywhere else where <literal>EXEC_BACKEND</literal> is
defined) or in dynamic background workers it is not safe to pass a
<type>Datum</type> by reference, only by value. If an argument is required, it
is safest to pass an int32 or other small value and use that as an index
into an array allocated in shared memory. If a value like a <type>cstring</type>
or <type>text</type> is passed then the pointer won't be valid from the
new background worker process.
Sur Windows (et partout où <literal>EXEC_BACKEND</literal> est défini) ou
dans des processus en tache de fond dynamiques, il n'est pas sûre de passer
un <type>Datum</type> par référence, il faut le passe par valeur. Si un
argument est requis, il est plus sûr de passer un int32 ou toute autre petite
valeur et l'utiliser comme un index d'un tableau alloué en mémoire partagée.
Si une valeur comme un <type>cstring</type> ou un <type>text</type> est
passée, alors le pointeur ne sera pas valide à partir du nouveau processus
en tâche de fond.
</para>

<para>
Expand Down Expand Up @@ -289,15 +293,15 @@ typedef struct BackgroundWorker
</para>

<para>
If a background worker sends asynchronous notifications with the
<command>NOTIFY</command> command via the Server Programming Interface
(<acronym>SPI</acronym>), it should call
<function>ProcessCompletedNotifies</function> explicitly after committing
the enclosing transaction so that any notifications can be delivered. If a
background worker registers to receive asynchronous notifications with
the <command>LISTEN</command> through <acronym>SPI</acronym>, the worker
will log those notifications, but there is no programmatic way for the
worker to intercept and respond to those notifications.
Si un processus en tâche de fond envoie des notifications asynchrones avec
la commande <command>NOTIFY</command> via <acronym>SPI</acronym>), il devrait
appeler <function>ProcessCompletedNotifies</function> explicitement après
avoir validé la transaction englobante pour que les notifications soient
envoyées. Si un processus en tâche de fond se déclare pour recevoir des
notifications asynchrones avec <command>LISTEN</command> via
<acronym>SPI</acronym>, le processus tracera les notifications. Cependant,
il n'existe pas de façon programmé pour que le processus intercepte et
réponde à ces notifications.
</para>

<para>
Expand Down
87 changes: 45 additions & 42 deletions postgresql/libpq.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1503,11 +1503,11 @@ typedef struct
<term><function>PQhost</function><indexterm><primary>PQhost</primary></indexterm></term>
<listitem>
<para>
Renvoie le nom d'hôte du serveur utilisé pour la connexion.
This can be a host name, an IP address, or a directory path if the
connection is via Unix socket. (The path case can be distinguished
because it will always be an absolute path, beginning
with <literal>/</literal>.)
Renvoie le nom d'hôte du serveur utilisé pour la connexion. Cela peut
être un nom d'hôte, une adresse IP ou un chemin de répertoire (pour ce
dernier, ceci ne survient que si la connexion est réalisée via un socket
Unix). Le cas du chemin peut être distingué car il sera toujours un
chemin absolu, commençant avec <literal>/</literal>.)
<synopsis>char *PQhost(const PGconn *conn);
</synopsis>
</para>
Expand Down Expand Up @@ -2606,34 +2606,35 @@ void *PQgetssl(const PGconn *conn);

<listitem>
<para>
Returns a reformatted version of the error message associated with
a <structname>PGresult</structname> object.
Renvoie une version reformatée du message d'erreur associé avec un objet
<structname>PGresult</structname>.
<synopsis>
char *PQresultVerboseErrorMessage(const PGresult *res,
PGVerbosity verbosity,
PGContextVisibility show_context);
</synopsis>
In some situations a client might wish to obtain a more detailed
version of a previously-reported error.
<function>PQresultVerboseErrorMessage</function> addresses this need
by computing the message that would have been produced
by <function>PQresultErrorMessage</function> if the specified
verbosity settings had been in effect for the connection when the
given <structname>PGresult</structname> was generated. If
the <structname>PGresult</structname> is not an error result,
<quote>PGresult is not an error result</quote> is reported instead.
The returned string includes a trailing newline.
Dans certaines situations, un client pourrait souhaiter obtenir une
version plus détaillée d'une erreur déjà rapportée.
<function>PQresultVerboseErrorMessage</function> couvre ce besoin en
traitant le message tel qu'il aurait été produit par
<function>PQresultErrorMessage</function> si la configuration souhaitée
de la verbosité était en effet pour la connexion quand l'objet
<structname>PGresult</structname> donné a été généré. Si le
<structname>PGresult</structname> ne correspond pas une erreur,
<quote>PGresult is not an error result</quote> est renvoyé à la place.
La chaîne renvoyée inclut un retour à la ligne en fin de chaîne.
</para>

<para>
Unlike most other functions for extracting data from
a <structname>PGresult</structname>, the result of this function is a freshly
allocated string. The caller must free it
using <function>PQfreemem()</function> when the string is no longer needed.
Contrairement à la plupart des autres fonctions d'extraction de données
à partir d'un objet <structname>PGresult</structname>, le résultat de
cette fonction est une chaîne tout juste allouée. L'appelant doit la
libérer en utilisant <function>PQfreemem()</function> quand la chaîne
n'est plus nécessaire.
</para>

<para>
A NULL return is possible if there is insufficient memory.
Un NULL est possible en retour s'il n'y a pas suffisamment de mémoire.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -5177,9 +5178,9 @@ char *PQresultVerboseErrorMessage(const PGresult *res,
astuce ou contexte (ils pourraient être sur plusieurs lignes). Le mode
<firstterm>VERBOSE</firstterm> inclut tous les champs disponibles. Modifier la verbosité
n'affecte pas les messages disponibles à partir d'objets
<structname>PGresult</structname> déjà existants, seulement ceux créés après.
(But see <function>PQresultVerboseErrorMessage</function> if you
want to print a previous error with a different verbosity.)
<structname>PGresult</structname> déjà existants, seulement ceux créés après
(mais voir <function>PQresultVerboseErrorMessage</function> si vous voulez
imprimer une erreur précédente avec une verbosité différente).
</para>
</listitem>
</varlistentry>
Expand All @@ -5194,9 +5195,9 @@ char *PQresultVerboseErrorMessage(const PGresult *res,

<listitem>
<para>
Determines the handling of <literal>CONTEXT</literal> fields in messages
returned by <function>PQerrorMessage</function>
and <function>PQresultErrorMessage</function>.
Détermine la gestion des champs <literal>CONTEXT</literal> dans les
messages renvoyées par <function>PQerrorMessage</function> et
<function>PQresultErrorMessage</function>.
<synopsis>
typedef enum
{
Expand All @@ -5208,20 +5209,22 @@ typedef enum
PGContextVisibility PQsetErrorContextVisibility(PGconn *conn, PGContextVisibility show_context);
</synopsis>

<function>PQsetErrorContextVisibility</function> sets the context display mode,
returning the connection's previous setting. This mode controls
whether the <literal>CONTEXT</literal> field is included in messages
(unless the verbosity setting is <firstterm>TERSE</firstterm>, in which
case <literal>CONTEXT</literal> is never shown). The <firstterm>NEVER</firstterm> mode
never includes <literal>CONTEXT</literal>, while <firstterm>ALWAYS</firstterm> always
includes it if available. In <firstterm>ERRORS</firstterm> mode (the
default), <literal>CONTEXT</literal> fields are included only for error
messages, not for notices and warnings. Changing this mode does not
affect the messages available from
already-existing <structname>PGresult</structname> objects, only
subsequently-created ones.
(But see <function>PQresultVerboseErrorMessage</function> if you
want to print a previous error with a different display mode.)
<function>PQsetErrorContextVisibility</function> configure le mode
d'affichage du contexte, renvoyant la précédente configuration de la
connexion. Ce mode contrôle si le champ <literal>CONTEXT</literal> est
inclus dans les messages (sauf si la verbosité est configurée à
<firstterm>TERSE</firstterm>, auquel cas <literal>CONTEXT</literal> n'est
jamais affiché). Le mode <firstterm>NEVER</firstterm> n'inclut jamais
<literal>CONTEXT</literal> alors que <firstterm>ALWAYS</firstterm> l'inclut
en permanence s'il est disponible. Dans le mode par défaut,
<firstterm>ERRORS</firstterm>, les champs <literal>CONTEXT</literal> sont
inclus seulement pour les messages d'erreur, et non pas pour les messages
d'informations et d'avertissements. La modification de ce mode n'affecte
pas les messages disponibles à partir des objets
<structname>PGresult</structname> déjà existant, seulement ceux créés
après. (Cependant, voir <function>PQresultVerboseErrorMessage</function>
si vous voulez imprimer l'erreur précédent avec un mode d'affichage
différent.)
</para>
</listitem>
</varlistentry>
Expand Down

0 comments on commit 8c9a061

Please sign in to comment.