| 11 | | <para> &slony1; does not directly provide support for the &postgres; |
|---|
| 12 | | methodology of partitioning via inheritance, but it does not, by the |
|---|
| 13 | | same token, prevent the Gentle User from using that sort of |
|---|
| 14 | | replication scheme, and then replicating the underlying |
|---|
| 15 | | tables. </para> |
|---|
| | 11 | <para> &slony1; ne supporte pas directement la méthode de partitionnement |
|---|
| | 12 | par héritage de &postgres;, cependant il n'empêche pas non plus les |
|---|
| | 13 | utilisateur de répliquer de tels héritages et ainsi que les tables |
|---|
| | 14 | qui y sont associées.</para> |
|---|
| 17 | | <para> One of the tests in the <xref linkend="testbed"/>, called |
|---|
| 18 | | <filename>testinherit</filename>, tests that &slony1; behaves as |
|---|
| 19 | | expected to replicate data across partitions. This test creates a |
|---|
| 20 | | master <envar>sales_data</envar> table, from which various children |
|---|
| 21 | | inherit: </para> |
|---|
| | 16 | <para> Un des tests du <xref linkend="testbed"/>, appelé |
|---|
| | 17 | <filename>testinherit</filename>, vérifie que &slony1; se comporte |
|---|
| | 18 | comme prévu lors de la réplication de données partitionnées. Ce test |
|---|
| | 19 | crée une table maître <envar>sales_data</envar> dont plusieurs tables filles héritent : </para> |
|---|
| 29 | | <para> The example is somewhat simplistic as it only provides rules to |
|---|
| 30 | | handle initial insertion into the respective partitions; it does not |
|---|
| 31 | | then support allowing tuples to migrate from partition to partition if |
|---|
| 32 | | they are altered via an <COMMAND>UPDATE</COMMAND> statement. On the |
|---|
| 33 | | other hand, unlike with many partitioning cases, this one permits the |
|---|
| 34 | | <quote>parent</quote> table to contain tuples. </para> |
|---|
| | 27 | <para> Cet exemple est un peu simpliste car il fournit uniquement des rÚgles |
|---|
| | 28 | d'insertion dans les différentes partitions; il ne permet pas de migrer des |
|---|
| | 29 | tuples d'une partition à une autre si ils sont modifiés via une commande |
|---|
| | 30 | <COMMAND>UPDATE</COMMAND> statement. D'un autre coté, à la différence de |
|---|
| | 31 | de beaucoup de partitionnement, celui-ci permet à la table <quote>parente</quote> |
|---|
| | 32 | de contenir des tuples. </para> |
|---|
| 46 | | <para> One common <quote>use case</quote> of replication is to |
|---|
| 47 | | partition large data sets based on time period, whether weekly, |
|---|
| 48 | | monthly, quarterly, or annually, where there is therefore a need to |
|---|
| 49 | | periodically add a new partition. </para> |
|---|
| | 45 | <para> Un <quote>cas d'utilisation</quote> fréquent de la réplication consiste |
|---|
| | 46 | à partitionner de large ensemble de données selon un critÚre temporel : la semaine, |
|---|
| | 47 | le moins, le trimestre ou l'année, ce qui implique par conséquent l'ajout périodique |
|---|
| | 48 | d'une nouvelle partition. </para> |
|---|
| 55 | | <listitem><para> <xref linkend="stmtddlscript"/> to add the new partition(s) on each node </para> </listitem> |
|---|
| 56 | | <listitem><para> <xref linkend="stmtcreateset"/> to create a temporary replication set </para> </listitem> |
|---|
| 57 | | <listitem><para> <xref linkend="stmtsetaddtable"/> to add the table(s) to that set </para> </listitem> |
|---|
| 58 | | <listitem><para> <xref linkend="stmtsubscribeset"/>, once for each subscriber node, to set up replication of the table on each node </para> </listitem> |
|---|
| 59 | | <listitem><para> <xref linkend="stmtmergeset"/>, once subscriptions are running, to eliminate the temporary set </para> </listitem> |
|---|
| | 53 | <listitem><para> <xref linkend="stmtddlscript"/> pour ajouter la nouvelle table de partition sur chaque noeud</para> </listitem> |
|---|
| | 54 | <listitem><para> <xref linkend="stmtcreateset"/> pour créer un ensemble de réplication temporaire </para> </listitem> |
|---|
| | 55 | <listitem><para> <xref linkend="stmtsetaddtable"/> pour ajouter la table dans cet ensemble </para> </listitem> |
|---|
| | 56 | <listitem><para> <xref linkend="stmtsubscribeset"/>, une fois pour chaque noeud abonné, afin de mettre en place |
|---|
| | 57 | la réplication sur chaque noeud </para> </listitem> |
|---|
| | 58 | <listitem><para> <xref linkend="stmtmergeset"/>, une fois que la réplication fonctionne, afin de supprimer |
|---|
| | 59 | l'ensemble de réplication temporaire </para> </listitem> |
|---|
| 62 | | <para> In view of the fact that we can be certain that a |
|---|
| 63 | | thus-far-unused partition will be empty, we offer an alternative |
|---|
| 64 | | mechanism which evades the need to create extra replication sets and |
|---|
| 65 | | the need to submit multiple <xref linkend="stmtsubscribeset"/> |
|---|
| 66 | | requests. The alternative is as follows; we use <xref |
|---|
| 67 | | linkend="stmtddlscript"/>, extending the DDL script thus: </para> |
|---|
| | 62 | <para> Sachant qu'il y a de fortes chances pour que la nouvelle partition soit vide, |
|---|
| | 63 | il existe un mécanisme alternatif qui évite de créer un ensemble de réplication |
|---|
| | 64 | supplémentaire et l'utilisation de multiples requêtes <xref linkend="stmtsubscribeset"/> |
|---|
| | 65 | Cette alternative est la suivante : on utilise le script <xref |
|---|
| | 66 | linkend="stmtddlscript"/>, pour effectuer le script DDL suivant : </para> |
|---|
| 73 | | <para> On the origin node, if the table is found to have tuples in it, |
|---|
| 74 | | the DDL script will be aborted, as the precondition that it be empty |
|---|
| 75 | | has been violated. </para> |
|---|
| | 72 | <para> Sur le noeud d'origine, si la table de partitionnement contient des tuples, |
|---|
| | 73 | le script DDL s'arrêtera car le fait que la table soit vide est une condition qui ne |
|---|
| | 74 | peut pas être violée. </para> |
|---|
| 81 | | <para> There are several stored functions provided to support this; |
|---|
| 82 | | the Gentle User may use whichever seems preferable. The <quote>base |
|---|
| 83 | | function</quote> is <function>add_empty_table_to_replication()</function>; the others |
|---|
| 84 | | provide additional structure and validation of the arguments </para> |
|---|
| | 80 | <para> Il existe plusieurs fonctions qui prennent en charge cela : |
|---|
| | 81 | L'utilisateur peut utiliser celle qu'il préfÚre. La <quote> fonction de |
|---|
| | 82 | base </quote> est <function>add_empty_table_to_replication()</function>; les |
|---|
| | 83 | autres disposent d'arguments supplémentaires ou différents</para> |
|---|
| 89 | | <para> This is the <quote>base</quote> function; you must specify the |
|---|
| 90 | | set ID, table ID, namespace name, table name, index name, and a |
|---|
| 91 | | comment, and this table will be added to replication. </para> |
|---|
| | 88 | <para> Ceci est la fonction de <quote>base</quote>; vous devez spécifier |
|---|
| | 89 | l'identifiant de l'ensemble (set_id), l'identifiant de la table (tab_id), |
|---|
| | 90 | l'espace de nom (nspname), le nom de la table(tabname), le nom de l'index (idxname) |
|---|
| | 91 | et un commentaire (comment) . La table sera alors ajouté dans la réplication. </para> |
|---|
| 93 | | <para> Note that the index name is optional; if NULL, the function |
|---|
| 94 | | will look up the primary key for the table, assuming one exists, and |
|---|
| 95 | | fail if it does not exist. </para> |
|---|
| | 93 | <para> Notez que le nom d'index est optionnel; si la valeur est NULL, alors |
|---|
| | 94 | la fonction utilisera la clé primaire de la table, en supposant qu'il en existe une. |
|---|
| | 95 | La fonction échouera s'il n'existe pas de clé primaire. </para> |
|---|
| 109 | | <note><para> As has been observed previously, &slony1; is unaware that |
|---|
| 110 | | tables are partitioned. Therefore, this approach may also be used |
|---|
| 111 | | with confidence to add any table to replication that is known to be |
|---|
| 112 | | empty. </para> </note> |
|---|
| | 108 | <note><para> Comme il a été remarqué précédemment, &slony1; n'est pas conscient |
|---|
| | 109 | que les tables sont partitionnées. Ainsi, cette approche peut être utilisée |
|---|
| | 110 | pour ajouter une table vide dans la réplication. </para> </note> |
|---|