Skip to content

Commit

Permalink
Changements version 12 pour dix commandes CREATE.
Browse files Browse the repository at this point in the history
  • Loading branch information
dverite committed Jul 29, 2019
1 parent 31a45b7 commit b7ebd12
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 99 deletions.
17 changes: 9 additions & 8 deletions postgresql/ref/create_aggregate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ CREATE [ OR REPLACE ] AGGREGATE <replaceable class="parameter">nom</replaceable>

<para>
<command>CREATE AGGREGATE</command> définit une nouvelle fonction d'agrégat.
<command>CREATE OR REPLACE AGGREGATE</command> will either define a new
aggregate function or replace an existing definition.
<command>CREATE OR REPLACE AGGREGATE</command> définit une nouvelle fonction
d'agrégat ou remplace une définition existante.
Quelques fonctions d'agrégat basiques et largement utilisées sont fournies
dans la distribution standard&nbsp;; elles sont documentées dans le
<xref linkend="functions-aggregate"/>.
Expand All @@ -102,10 +102,11 @@ CREATE [ OR REPLACE ] AGGREGATE <replaceable class="parameter">nom</replaceable>
</para>

<para>
When replacing an existing definition, the argument types, result type,
and number of direct arguments may not be changed. Also, the new definition
must be of the same kind (ordinary aggregate, ordered-set aggregate, or
hypothetical-set aggregate) as the old one.
Lorsqu'une définition existante est remplacée, les types d'arguments,
le type de résultat, et le nombre d'arguments directs ne peuvent être
changés. La nouvelle définition doit également être du même type
(agrégat ordinaire, ou d'ensemble trié, ou d'ensemble hypothétique)
que l'ancien.
</para>

<para>
Expand Down Expand Up @@ -222,12 +223,12 @@ CREATE [ OR REPLACE ] AGGREGATE <replaceable class="parameter">nom</replaceable>
</para>

<para>
La syntaxe avec <literal>ORDER BY</literal> dans le liste des paramètres
La syntaxe avec <literal>ORDER BY</literal> dans la liste des paramètres
crée un type spécial d'agrégat appelé un <firstterm>agrégat d'ensemble
trié</firstterm>. Si le mot clé <literal>HYPOTHETICAL</literal> est ajouté,
un <firstterm>agrégat d'ensemble hypothétique</firstterm> est créé. Ces
agrégats opèrent sur des groupes de valeurs triées, donc la spécification
d'un ordre de tri en entrée est une partie essentiel d'un appel. De plus,
d'un ordre de tri en entrée est une partie essentielle d'un appel. De plus,
ils peuvent avoir des arguments <firstterm>directs</firstterm>, qui sont
des arguments évalués une fois seulement par agrégat plutôt qu'une fois par
ligne en entrée. Les agrégats d'ensemble hypothétique sont une sous-classe
Expand Down
36 changes: 19 additions & 17 deletions postgresql/ref/create_domain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,29 @@ INSERT INTO tab (domcol) VALUES ((SELECT domcol FROM tab WHERE false));
</para>

<para>
<productname>PostgreSQL</productname> assumes that
<literal>CHECK</literal> constraints' conditions are immutable, that is,
they will always give the same result for the same input value. This
assumption is what justifies examining <literal>CHECK</literal>
constraints only when a value is first converted to be of a domain type,
and not at other times. (This is essentially the same as the treatment
of table <literal>CHECK</literal> constraints, as described in
<productname>PostgreSQL</productname> suppose que les conditions
des contraintes <literal>CHECK</literal> sont immuables, c'est-à-dire
qu'elles produisent toujours les mêmes résultats pour les mêmes valeurs
d'entrée. Cette supposition justifie que l'examen des contraintes
<literal>CHECK</literal> est effectué seulement quand une valeur est
initialement convertie vers le type domaine, et pas à d'autres moments.
(C'est essentiellement le même traitement que les contraintes
<literal>CHECK</literal> s'appliquant aux tables, comme décrit dans
<xref linkend="ddl-constraints-check-constraints"/>.)
</para>

<para>
An example of a common way to break this assumption is to reference a
user-defined function in a <literal>CHECK</literal> expression, and then
change the behavior of that
function. <productname>PostgreSQL</productname> does not disallow that,
but it will not notice if there are stored values of the domain type that
now violate the <literal>CHECK</literal> constraint. That would cause a
subsequent database dump and reload to fail. The recommended way to
handle such a change is to drop the constraint (using <command>ALTER
DOMAIN</command>), adjust the function definition, and re-add the
constraint, thereby rechecking it against stored data.
Un exemple typique contrevenant à cette supposition consiste à faire
référence à une fonction définie par l'utilisateur dans l'expression
<literal>CHECK</literal>, puis de modifier le comportement de cette fonction.
<productname>PostgreSQL</productname> n'interdit pas cela,
mais il ne pourra pas remarquer qu'il y a des valeurs stockées dans
le type du domaine qui seraient en violation de la contrainte <literal>CHECK</literal>.
Cette situation peut ainsi provoquer l'échec du rechargement d'une
sauvegarde faite par export. La méthode recommandée pour mener à bien
ce type de changement consiste à supprimer la contrainte (en utilisant
<command>ALTER DOMAIN</command>), à changer la définition de la fonction,
puis à remettre la contrainte, ce qui la testera sur les données stockées.
</para>
</refsect1>

Expand Down
40 changes: 21 additions & 19 deletions postgresql/ref/create_foreign_table.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CREATE FOREIGN TABLE [ IF NOT EXISTS ] <replaceable class="PARAMETER">nom_table<
NULL |
CHECK ( <replaceable class="PARAMETER">expression</replaceable> ) [ NO INHERIT ] |
DEFAULT <replaceable>expr_defaut</replaceable> |
GENERATED ALWAYS AS ( <replaceable>generation_expr</replaceable> ) STORED }
GENERATED ALWAYS AS ( <replaceable>expr_generation</replaceable> ) STORED }

<phrase>et <replaceable class="PARAMETER">contrainte_table</replaceable> vaut&nbsp;:</phrase>

Expand Down Expand Up @@ -262,25 +262,26 @@ CHECK ( <replaceable class="PARAMETER">expression</replaceable> ) [ NO INHERIT ]
</varlistentry>

<varlistentry>
<term><literal>GENERATED ALWAYS AS ( <replaceable>generation_expr</replaceable> ) STORED</literal><indexterm><primary>generated column</primary></indexterm></term>
<term><literal>GENERATED ALWAYS AS ( <replaceable>expr_generation</replaceable> ) STORED</literal><indexterm><primary>colonne générée</primary></indexterm></term>
<listitem>
<para>
This clause creates the column as a <firstterm>generated
column</firstterm>. The column cannot be written to, and when read the
result of the specified expression will be returned.
Cette clause créé la colonne en tant que <firstterm>colonne générée</firstterm>.
La colonne ne peut pas faire l'objet d'une écriture, et quand elle est lue, c'est
le résultat de l'expression spécifiée qui est renvoyé.
</para>

<para>
The keyword <literal>STORED</literal> is required to signify that the
column will be computed on write. (The computed value will be presented
to the foreign-data wrapper for storage and must be returned on
reading.)
Le mot-clé <literal>STORED</literal> est nécessaire pour indiquer que
la colonne va être calculée au moment de l'écriture. (La valeur calculée
sera présentée au wrapper de données distantes pour stockage et doit être
renvoyée en lecture.)
</para>

<para>
The generation expression can refer to other columns in the table, but
not other generated columns. Any functions and operators used must be
immutable. References to other tables are not allowed.
L'expression de génération peut se référer à d'autres colonnes de la
table, mais pas à d'autres colonnes générées. Toutes les fonctions et
opérateurs qu'elle utilise doivent être immuables. Les références à
d'autres tables ne sont pas autorisées.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -348,13 +349,14 @@ CHECK ( <replaceable class="PARAMETER">expression</replaceable> ) [ NO INHERIT ]
</para>

<para>
Similar considerations apply to generated columns. Stored generated
columns are computed on insert or update on the local
<productname>PostgreSQL</productname> server and handed to the
foreign-data wrapper for writing out to the foreign data store, but it is
not enforced that a query of the foreign table returns values for stored
generated columns that are consistent with the generation expression.
Again, this might result in incorrect query results.
Des considérations similaires s'appliquent aux colonnes générées. Les
colonnes générées stockées sont calculées au moment de l'insertion
et des mises à jour sur le serveur <productname>PostgreSQL</productname>
local, et passés au wrapper de données distantes pour les écrire dans
le stockage distant, mais il n'est pas garanti qu'une requête sur la
table distante renvoie des valeurs pour les colonnes générées en cohérence
avec l'expression de génération. A nouveau, cela peut engendrer des
résultats de requête incorrects.
</para>

<para>
Expand Down
12 changes: 6 additions & 6 deletions postgresql/ref/create_function.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
| PARALLEL { UNSAFE | RESTRICTED | SAFE }
| COST <replaceable class="parameter">cout_execution</replaceable>
| ROWS <replaceable class="parameter">nb_lignes_resultat</replaceable>
| SUPPORT <replaceable class="parameter">support_function</replaceable>
| SUPPORT <replaceable class="parameter">fonction_support</replaceable>
| SET <replaceable class="parameter">parametre</replaceable> { TO <replaceable class="parameter">value</replaceable> | = <replaceable class="parameter">value</replaceable> | FROM CURRENT }
| AS '<replaceable class="parameter">definition</replaceable>'
| AS '<replaceable class="parameter">fichier_obj</replaceable>', '<replaceable class="parameter">symbole_lien</replaceable>'
Expand Down Expand Up @@ -502,14 +502,14 @@
</varlistentry>

<varlistentry>
<term><literal>SUPPORT</literal> <replaceable class="parameter">support_function</replaceable></term>
<term><literal>SUPPORT</literal> <replaceable class="parameter">fonction_support</replaceable></term>

<listitem>
<para>
The name (optionally schema-qualified) of a <firstterm>planner support
function</firstterm> to use for this function. See
<xref linkend="xfunc-optimization"/> for details.
You must be superuser to use this option.
Le nom (optionnellement qualifié du nom du schéma) d'une <firstterm>fonction
de support de planification</firstterm> à utiliser pour cette fonction.
Voir <xref linkend="xfunc-optimization"/> pour plus d'informations.
Il faut être superutilisateur pour utiliser cette option.
</para>
</listitem>
</varlistentry>
Expand Down
14 changes: 7 additions & 7 deletions postgresql/ref/create_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
<varlistentry id="index-reloption-fillfactor" xreflabel="fillfactor">
<term><literal>fillfactor</literal>
<indexterm>
<primary><varname>fillfactor</varname> storage parameter</primary>
<primary>paramètre de stockage <varname>fillfactor</varname></primary>
</indexterm>
</term>
<listitem>
Expand Down Expand Up @@ -410,7 +410,7 @@
<term><literal>vacuum_cleanup_index_scale_factor</literal>
<indexterm>
<primary><varname>vacuum_cleanup_index_scale_factor</varname></primary>
<secondary>storage parameter</secondary>
<secondary>paramètre de stockage</secondary>
</indexterm>
</term>
<listitem>
Expand All @@ -430,7 +430,7 @@
<varlistentry id="index-reloption-buffering" xreflabel="buffering">
<term><literal>buffering</literal>
<indexterm>
<primary><varname>buffering</varname> storage parameter</primary>
<primary>paramètre de stockage <varname>buffering</varname></primary>
</indexterm>
</term>
<listitem>
Expand All @@ -456,7 +456,7 @@
<varlistentry id="index-reloption-fastupdate" xreflabel="fastupdate">
<term><literal>fastupdate</literal>
<indexterm>
<primary><varname>fastupdate</varname> storage parameter</primary>
<primary>paramètre de stockage <varname>fastupdate</varname></primary>
</indexterm>
</term>
<listitem>
Expand Down Expand Up @@ -489,7 +489,7 @@
<term><literal>gin_pending_list_limit</literal>
<indexterm>
<primary><varname>gin_pending_list_limit</varname></primary>
<secondary>storage parameter</secondary>
<secondary>paramètre de stockage</secondary>
</indexterm>
</term>
<listitem>
Expand All @@ -509,7 +509,7 @@
<varlistentry id="index-reloption-pages-per-range" xreflabel="pages_per_range">
<term><literal>pages_per_range</literal>
<indexterm>
<primary><varname>pages_per_range</varname> storage parameter</primary>
<primary>paramètre de stockage <varname>pages_per_range</varname></primary>
</indexterm>
</term>
<listitem>
Expand All @@ -525,7 +525,7 @@
<varlistentry id="index-reloption-autosummarize" xreflabel="autosummarize">
<term><literal>autosummarize</literal>
<indexterm>
<primary><varname>autosummarize</varname> storage parameter</primary>
<primary>paramètre de stockage <varname>autosummarize</varname></primary>
</indexterm>
</term>
<listitem>
Expand Down
20 changes: 10 additions & 10 deletions postgresql/ref/create_materialized_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<synopsis>
CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>nom_table</replaceable>
[ (<replaceable>nom_colonne</replaceable> [, ...] ) ]
[ USING <replaceable class="parameter">method</replaceable> ]
[ USING <replaceable class="parameter">méthode</replaceable> ]
[ WITH ( <replaceable class="parameter">paramètre_stockage</replaceable> [= <replaceable class="parameter">valeur</replaceable>] [, ... ] ) ]
[ TABLESPACE <replaceable class="parameter">nom_tablespace</replaceable> ]
AS <replaceable>requête</replaceable>
Expand Down Expand Up @@ -86,16 +86,16 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>nom_table</replaceable>
</varlistentry>

<varlistentry>
<term><literal>USING <replaceable class="parameter">method</replaceable></literal></term>
<term><literal>USING <replaceable class="parameter">méthode</replaceable></literal></term>
<listitem>
<para>
This optional clause specifies the table access method to use to store
the contents for the new materialized view; the method needs be an
access method of type <literal>TABLE</literal>. See <xref
linkend="tableam"/> for more information. If this option is not
specified, the default table access method is chosen for the new
materialized view. See <xref linkend="guc-default-table-access-method"/>
for more information.
Cette clause optionnelle indique la méthode d'accès à la table à utiliser
pour stocker le contenu de la nouvelle vue matérialisée; la méthode doit être
une méthode d'accès de type <literal>TABLE</literal>. Voir <xref
linkend="tableam"/> pour plus d'informations. Si cette option n'est pas spécifiée,
la méthode d'accès par défaut à la table est choisie pour la nouvelle vue
matérialisée. Voir <xref linkend="guc-default-table-access-method"/>
pour plus d'informations.
</para>
</listitem>
</varlistentry>
Expand All @@ -108,7 +108,7 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>nom_table</replaceable>
vue matérialisée&nbsp;; voir <xref linkend="sql-createtable-storage-parameters"
endterm="sql-createtable-storage-parameters-title"/> pour plus
d'informations. Tous les paramètres supportés pour <literal>CREATE
TABLE</literal> sont aussi supportés supported par <literal>CREATE
TABLE</literal> sont aussi supportés par <literal>CREATE
MATERIALIZED VIEW</literal>.
Voir <xref linkend="sql-createtable"/> pour plus d'informations.
</para>
Expand Down
18 changes: 10 additions & 8 deletions postgresql/ref/create_statistics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ CREATE STATISTICS [ IF NOT EXISTS ] <replaceable class="parameter">nom_statistiq
Les types actuellement supportés sont
<literal>ndistinct</literal>, qui active des statistiques n-distinct,
<literal>dependencies</literal> qui active des statistiques de dépendances
fonctionnelles, and <literal>mcv</literal> which enables
most-common values lists.
fonctionnelles, et <literal>mcv</literal> qui active les listes
des valeurs les plus fréquentes.
Si cette clause est omise, tous les types statistiques supportés sont
inclus dans l'objet statistique.
Pour plus d'informations, voir <xref linkend="planner-stats-extended"/>
Expand Down Expand Up @@ -171,8 +171,9 @@ EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0);
</para>

<para>
Create table <structname>t2</structname> with two perfectly correlated columns
(containing identical data), and a MCV list on those columns:
Créer une table <structname>t2</structname> avec deux colonnes parfaitement
corrélées (contenant des données identiques), et une liste MCV sur ces
colonnes:

<programlisting>
CREATE TABLE t2 (
Expand All @@ -194,10 +195,11 @@ EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 1);
EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2);
</programlisting>

The MCV list gives the planner more detailed information about the
specific values that commonly appear in the table, as well as an upper
bound on the selectivities of combinations of values that do not appear
in the table, allowing it to generate better estimates in both cases.
La liste MCV donne au planificateur des informations plus détaillées
à propos des valeurs spécifiques qui apparaissent le plus fréquemment
dans la table, de même qu'une borne supérieure sur les sélectivités
des combinaisons de valeurs qui n'apparaissent pas dans la table,
lui permettant de générer de meilleures estimations dans les deux cas.
</para>

</refsect1>
Expand Down

0 comments on commit b7ebd12

Please sign in to comment.