A <firstterm>publication</firstterm> can be defined on any physical replication primary. The node where a publication is defined is referred to as <firstterm>publisher</firstterm>. A publication is a set of changes generated from a table or a group of tables, and might also be described as a change set or replication set. Each publication exists in only one database. パブリケーションは、どのような物理レプリケーションのプライマリにも定義できます。 パブリケーションが定義されたノードは、パブリッシャーと呼ばれます。 パブリケーションは、テーブルか、テーブルのグループから生成された更新の集合であると同時に、更新セットあるいはレプリケーションセットであるとも言えます。 一つのパブリケーションは一つのデータベースにのみ存在します。
Publications are different from schemas and do not affect how the table is
accessed. Each table can be added to multiple publications if needed.
Publications may currently only contain tables and all tables in schema.
Objects must be added explicitly, except when a publication is created for
<literal>ALL TABLES</literal>.
パブリケーションはスキーマとは異なり、テーブルがどのようにアクセスされるかには影響しません。
必要ならば、テーブルを複数のパブリケーションに追加できます。
今のところパブリケーションはテーブルとスキーマのすべてのテーブルのみを含むことができます。
パブリケーションがALL TABLES
で作られた場合を除き、オブジェクトは明示的に追加されなければなりません。
Publications can choose to limit the changes they produce to
any combination of <command>INSERT</command>, <command>UPDATE</command>,
<command>DELETE</command>, and <command>TRUNCATE</command>, similar to how triggers are fired by
particular event types. By default, all operation types are replicated.
These publication specifications apply only for DML operations; they do not affect the initial
data synchronization copy. (Row filters have no effect for
<command>TRUNCATE</command>. See <xref linkend="logical-replication-row-filter"/>).
パブリケーションは、生成される更新を、INSERT
、UPDATE
、DELETE
、TRUNCATE
のうちのどのような組み合わせにも制限することができます。
これはトリガが特定のイベント型によって起動されることに似ています。
デフォルトでは、すべての操作タイプがレプリケーションされます。
これらのパブリケーション指定はDML操作にのみ適用され、初期データ同期コピーには影響しません(行フィルタはTRUNCATE
には影響しません。29.4を参照してください)
Every publication can have multiple subscribers. すべてのパブリケーションは、複数のサブスクライバーを持つことができます。
A publication is created using the <link linkend="sql-createpublication"><command>CREATE PUBLICATION</command></link>
command and may later be altered or dropped using corresponding commands.
パブリケーションは、CREATE PUBLICATION
コマンドで作成し、対応するコマンドで変更や削除ができます。
The individual tables can be added and removed dynamically using
<link linkend="sql-alterpublication"><command>ALTER PUBLICATION</command></link>. Both the <literal>ADD
TABLE</literal> and <literal>DROP TABLE</literal> operations are
transactional, so the table will start or stop replicating at the correct
snapshot once the transaction has committed.
《マッチ度[95.170455]》個々のテーブルはALTER PUBLICATION
で動的に追加削除できます。
ADD TABLE
およびDROP TABLE
操作はトランザクションの対象です。
ひとたびトランザクションがコミットされれば、正しいスナップショットでテーブルのレプリケーションが開始あるいは終了されます。
A published table must have a <firstterm>replica identity</firstterm>
configured in order to be able to replicate <command>UPDATE</command>
and <command>DELETE</command> operations, so that appropriate rows to
update or delete can be identified on the subscriber side.
《機械翻訳》公開されたテーブルは、UPDATE
およびDELETE
操作をレプリケートできるようにするために、レプリカアイデンティティが設定されていなければなりません。
これにより、サブスクライバー側で更新または削除する適切な行を特定できます。
By default, this is the primary key, if there is one. Another unique index
(with certain additional requirements) can also be set to be the replica
identity. If the table does not have any suitable key, then it can be set
to replica identity <literal>FULL</literal>, which means the entire row
becomes the key. When replica identity <literal>FULL</literal> is
specified, indexes can be used on the subscriber side for searching the
rows. Candidate indexes must be btree or hash, non-partial, and the
leftmost index field must be a column (not an expression) that references
the published table column. These restrictions on the non-unique index
properties adhere to some of the restrictions that are enforced for
primary keys. If there are no such suitable indexes, the search on the
subscriber side can be very inefficient, therefore replica identity
<literal>FULL</literal> should only be used as a fallback if no other
solution is possible.
《機械翻訳》デフォルトでは、これは主キーがあればそれです。
別の一意インデックス(特定の追加要件があります)をレプリカアイデンティティに設定することもできます。
テーブルに適切なキーがない場合は、レプリカアイデンティティに設定できますFULL
行全体がキーになることを意味します。
レプリカアイデンティティFULL
が指定されている場合、検索行のサブスクライバー側で索引を使用できます。
候補索引は、非部分のbtreeまたはハッシュである必要があり、左端のインデックスフィールドは、公開されたテーブル列を参照するカラム(式ではない)である必要があります。
一意インデックス以外のプロパティに対するこれらの制限は、プライマリキーに適用されるいくつかの制限に準拠しています。
このような適切な索引がない場合、サブスクライバー側の検索は非常に非効率的になる可能性があるため、レプリカアイデンティティFULL
他の解決策が不可能な場合にのみフォールバックとして使用する必要があります。
If a replica identity other than <literal>FULL</literal> is set on the
publisher side, a replica identity comprising the same or fewer columns
must also be set on the subscriber side.
《機械翻訳》パブリッシャー側にFULL
以外のレプリカアイデンティティが設定されている場合は、サブスクライバー側にも同数以下の柱で構成されるレプリカアイデンティティを設定する必要があります。
Tables with a replica identity defined as <literal>NOTHING</literal>,
<literal>DEFAULT</literal> without a primary key, or <literal>USING
INDEX</literal> with a dropped index, cannot support
<command>UPDATE</command> or <command>DELETE</command> operations when
included in a publication replicating these actions. Attempting such
operations will result in an error on the publisher.
《機械翻訳》レプリカアイデンティティがNOTHING
、DEFAULT
主キーなし、またはUSING INDEX
インデックス削除として定義された表では、これらのサポートをレプリケートするパブリケーションに含まれている場合、アクションUPDATE
またはDELETE
操作はできません。
このような操作を試行すると、パブリッシャーにエラーが作成されます。
<command>INSERT</command> operations can proceed regardless of any replica identity.
《機械翻訳》INSERT
レプリカアイデンティティに関係なく操作できます。
See <link linkend="sql-altertable-replica-identity"><literal>ALTER TABLE...REPLICA IDENTITY</literal></link>
for details on how to set the replica identity.
《機械翻訳》レプリカアイデンティティの設定方法については、ALTER TABLE...REPLICA IDENTITY
を参照してください。