バージョンごとのドキュメント一覧

31.11. 簡単な設定 #

<title>Quick Setup</title>

First set the configuration options in <filename>postgresql.conf</filename>: まずpostgresql.confの設定オプションを設定してください。

wal_level = logical

The other required settings have default values that are sufficient for a basic setup. 基本的な設定のためには、それ以外の設定はデフォルトのままで十分です。

<filename>pg_hba.conf</filename> needs to be adjusted to allow replication (the values here depend on your actual network configuration and user you want to use for connecting): pg_hba.confはレプリケーションを許可するために調整が必要です。 (ここで示した値は、実際のネットワーク設定と、接続に使用するユーザにより異なります。)

host     all     repuser     0.0.0.0/0     md5

Then on the publisher database: 次にパブリッシャーデータベースで以下を実行します。

CREATE PUBLICATION mypub FOR TABLE users, departments;

And on the subscriber database: サブスクライバーデータベースでは次を実行します。

CREATE SUBSCRIPTION mysub CONNECTION 'dbname=foo host=bar user=repuser' PUBLICATION mypub;

The above will start the replication process, which synchronizes the initial table contents of the tables <literal>users</literal> and <literal>departments</literal> and then starts replicating incremental changes to those tables. 上記により、テーブルusersdepartmentsの初期内容の同期プロセスが起動されます。 その後、これらのテーブルへの増分変更のレプリケーションが開始します。