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

29.13. アップグレード #

<title>Upgrade</title>

Migration of <glossterm linkend="glossary-logical-replication-cluster">logical replication clusters</glossterm> is possible only when all the members of the old logical replication clusters are version 17.0 or later. 論理レプリケーションクラスタの移行は、旧論理レプリケーションクラスタがすべてバージョン17.0以降の場合にのみ可能です。

29.13.1. パブリッシャーのアップグレードの準備 #

<title>Prepare for Publisher Upgrades</title>

<application>pg_upgrade</application> attempts to migrate logical slots. This helps avoid the need for manually defining the same logical slots on the new publisher. Migration of logical slots is only supported when the old cluster is version 17.0 or later. Logical slots on clusters before version 17.0 will silently be ignored. pg_upgradeは論理スロットの移行を試みます。 これは、新しいパブリッシャー上で同じ論理スロットを手動で定義する必要性を回避するのに役立ちます。 論理スロットの移行は、古いクラスタがバージョン17.0以降の場合にのみサポートされます。 バージョン17.0より前のクラスタ上の論理スロットは、警告なく無視されます。

Before you start upgrading the publisher cluster, ensure that the subscription is temporarily disabled, by executing <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>. Re-enable the subscription after the upgrade. パブリッシャークラスタのアップグレードを開始する前に、ALTER SUBSCRIPTION ... DISABLEを実行して、サブスクリプションが一時的に無効になっていることを確認してください。 アップグレード後にサブスクリプションを再度有効にしてください。

There are some prerequisites for <application>pg_upgrade</application> to be able to upgrade the logical slots. If these are not met an error will be reported. pg_upgradeが論理スロットをアップグレードできるようにするための前提条件がいくつかあります。 これらが満たされていない場合はエラーが報告されます。

  • The new cluster must have <link linkend="guc-wal-level"><varname>wal_level</varname></link> as <literal>logical</literal>. 新しいクラスタはwal_levellogicalにする必要があります。

  • The new cluster must have <link linkend="guc-max-replication-slots"><varname>max_replication_slots</varname></link> configured to a value greater than or equal to the number of slots present in the old cluster. 新しいクラスタは、古いクラスタに存在するスロットの数以上の値にmax_replication_slotsを設定する必要があります。

  • The output plugins referenced by the slots on the old cluster must be installed in the new PostgreSQL executable directory. 古いクラスタのスロットで参照される出力プラグインは、新しいPostgreSQLの実行ファイル格納ディレクトリにインストールする必要があります。

  • The old cluster has replicated all the transactions and logical decoding messages to subscribers. 古いクラスタは、すべてのトランザクションとロジカルデコーディングメッセージをサブスクライバーに複製済です。

  • All slots on the old cluster must be usable, i.e., there are no slots whose <link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>conflicting</structfield> is not <literal>true</literal>. 古いクラスタの全てのスロットが使用可能でなければなりません。 つまりpg_replication_slots.conflictingtrueであってはいけません。

  • The new cluster must not have permanent logical slots, i.e., there must be no slots where <link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>temporary</structfield> is <literal>false</literal>. 新しいクラスタは、永続的な論理スロットを持ってはなりません。 つまり、pg_replication_slots.temporaryfalseであってはいけません。

29.13.2. サブスクライバーのアップグレードの準備 #

<title>Prepare for Subscriber Upgrades</title>

Setup the <link linkend="logical-replication-config-subscriber"> subscriber configurations</link> in the new subscriber. <application>pg_upgrade</application> attempts to migrate subscription dependencies which includes the subscription's table information present in <link linkend="catalog-pg-subscription-rel">pg_subscription_rel</link> system catalog and also the subscription's replication origin. This allows logical replication on the new subscriber to continue from where the old subscriber was up to. Migration of subscription dependencies is only supported when the old cluster is version 17.0 or later. Subscription dependencies on clusters before version 17.0 will silently be ignored. 新しいサブスクライバーにサブスクライバー構成を設定します。 pg_upgradeは、pg_subscription_relシステムカタログに存在するサブスクリプションのテーブル情報と、サブスクリプションのレプリケーション元を含むサブスクリプション依存関係の移行を試みます。 これにより、新しいサブスクライバーで論理レプリケーションを、古いサブスクライバーが存在していた場所から継続できます。 サブスクリプションの依存関係の移行は、古いクラスタがバージョン17.0以降の場合にのみサポートされます。 バージョン17.0より前のクラスタに対するサブスクリプションの依存関係は、警告なく無視されます。

There are some prerequisites for <application>pg_upgrade</application> to be able to upgrade the subscriptions. If these are not met an error will be reported. pg_upgradeがサブスクリプションをアップグレードできるようにするための前提条件がいくつかあります。 これらが満たされていない場合はエラーが報告されます。

  • All the subscription tables in the old subscriber should be in state <literal>i</literal> (initialize) or <literal>r</literal> (ready). This can be verified by checking <link linkend="catalog-pg-subscription-rel">pg_subscription_rel</link>.<structfield>srsubstate</structfield>. 古いサブスクライバーのすべてのサブスクリプションテーブルはi(初期化)またはr(準備完了)の状態である必要があります。 これはpg_subscription_rel.srsubstateを調べることで確認できます。

  • The replication origin entry corresponding to each of the subscriptions should exist in the old cluster. This can be found by checking <link linkend="catalog-pg-subscription">pg_subscription</link> and <link linkend="catalog-pg-replication-origin">pg_replication_origin</link> system tables. 各サブスクリプションに対応するレプリケーション起点エントリは、古いクラスタに存在する必要があります。 これは、pg_subscriptionpg_replication_originシステムテーブルを調べることで見つけることができます。

  • The new cluster must have <link linkend="guc-max-active-replication-origins"><varname>max_active_replication_origins</varname></link> configured to a value greater than or equal to the number of subscriptions present in the old cluster. 新しいクラスタは、古いクラスタに存在するサブスクリプションの数以上の値にmax_replication_slotsを設定する必要があります。

29.13.3. 論理レプリケーションクラスタのアップグレード #

<title>Upgrading Logical Replication Clusters</title>

While upgrading a subscriber, write operations can be performed in the publisher. These changes will be replicated to the subscriber once the subscriber upgrade is completed. サブスクライバーをアップグレードしている間、書き込み操作はパブリッシャーでのみ実行できます。 これらの変更は、サブスクライバーのアップグレードが完了すると複製されます。

注記

The logical replication restrictions apply to logical replication cluster upgrades also. See <xref linkend="logical-replication-restrictions"/> for details. 論理レプリケーションの制限は、論理レプリケーションクラスタのアップグレードにも適用されます。 詳細は29.8を参照してください。

The prerequisites of publisher upgrade apply to logical replication cluster upgrades also. See <xref linkend="prepare-publisher-upgrades"/> for details. パブリッシャーアップグレードの前提条件は、論理レプリケーションクラスタのアップグレードにも適用されます。 詳細は29.13.1を参照してください。

The prerequisites of subscriber upgrade apply to logical replication cluster upgrades also. See <xref linkend="prepare-subscriber-upgrades"/> for details. サブスクライバーアップグレードの前提条件は、論理レプリケーションクラスタのアップグレードにも適用されます。 詳細は29.13.1を参照してください。

警告

Upgrading logical replication cluster requires multiple steps to be performed on various nodes. Because not all operations are transactional, the user is advised to take backups as described in <xref linkend="backup-base-backup"/>. 論理レプリケーションクラスタのアップグレードは、様々なノードで複数の手順を実行する必要があります。 すべての処理がトランザクションのように振る舞うわけではないため、25.3.2の手順に従ってバックアップを取得することをお薦めします。

The steps to upgrade the following logical replication clusters are detailed below: 論理レプリケーションクラスタをアップグレードする手順は以下の通りです。

  • Follow the steps specified in <xref linkend="steps-two-node-logical-replication-cluster"/> to upgrade a two-node logical replication cluster. 2ノードの論理レプリケーションクラスタをアップグレードする場合は、29.13.3.1に指定されている手順に従います。

  • Follow the steps specified in <xref linkend="steps-cascaded-logical-replication-cluster"/> to upgrade a cascaded logical replication cluster. カスケード論理レプリケーションクラスタをアップグレードする場合は、29.13.3.2に指定されている手順に従います。

  • Follow the steps specified in <xref linkend="steps-two-node-circular-logical-replication-cluster"/> to upgrade a two-node circular logical replication cluster. 2ノードの循環論理レプリケーションクラスタをアップグレードする場合は、29.13.3.3に指定されている手順に従います。

29.13.3.1. 2ノードの論理レプリケーションクラスタをアップグレードする手順 #

<title>Steps to Upgrade a Two-node Logical Replication Cluster</title>

Let's say publisher is in <literal>node1</literal> and subscriber is in <literal>node2</literal>. The subscriber <literal>node2</literal> has a subscription <literal>sub1_node1_node2</literal> which is subscribing the changes from <literal>node1</literal>. パブリッシャーがnode1にあり、サブスクライバーがnode2にあるとします。 サブスクライバーnode2には、node1から変更をサブスクライブしているサブスクリプションsub1_node1_node2があります。

  1. Disable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... DISABLEを使用して、node1からの変更をサブスクライブしているnode2上のすべてのサブスクリプションを無効にします。以下は、その例です。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 DISABLE;
    

  2. Stop the publisher server in <literal>node1</literal>, e.g.: node1にあるパブリッシャーサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data1 stop
    

  3. Initialize <literal>data1_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data1_upgradedインスタンスを初期化します。

  4. Upgrade the publisher <literal>node1</literal>'s server to the required newer version, e.g.: 必要とされる新しいバージョンを使用して、node1にあるパブリッシャーサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data1"
            --new-datadir "/opt/PostgreSQL/postgres/18/data1_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  5. Start the upgraded publisher server in <literal>node1</literal>, e.g.: node1にあるアップグレードされたパブリッシャーサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data1_upgraded start -l logfile
    

  6. Stop the subscriber server in <literal>node2</literal>, e.g.: node2にあるサブスクライバーサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data2 stop
    

  7. Initialize <literal>data2_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data2_upgradedインスタンスを初期化します。

  8. Upgrade the subscriber <literal>node2</literal>'s server to the required new version, e.g.: 必要とされる新しいバージョンを使用して、node2にあるサブスクライバーサーバをアップグレードします。

    pg_upgrade
           --old-datadir "/opt/PostgreSQL/postgres/17/data2"
           --new-datadir "/opt/PostgreSQL/postgres/18/data2_upgraded"
           --old-bindir "/opt/PostgreSQL/postgres/17/bin"
           --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  9. Start the upgraded subscriber server in <literal>node2</literal>, e.g.: node2にあるアップグレードされたサブスクライバーサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile
    

  10. On <literal>node2</literal>, create any tables that were created in the upgraded publisher <literal>node1</literal> server between <xref linkend="two-node-cluster-disable-subscriptions-node2"/> and now, e.g.: node2上で、ステップ 1と現在までの間に、パブリッシャーサーバnode1で作成されたすべてのテーブルを作成します。

    /* node2 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
    

  11. Enable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... ENABLEコマンドを使用して、node1からの変更をサブスクライブするnode2上のすべてのサブスクリプションを有効にします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 ENABLE;
    

  12. Refresh the <literal>node2</literal> subscription's publications using <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>, e.g.: ALTER SUBSCRIPTION ... REFRESH PUBLICATIONコマンドを使用して、node2サブスクリプションのパブリケーションをリフレッシュします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 REFRESH PUBLICATION;
    

注記

In the steps described above, the publisher is upgraded first, followed by the subscriber. Alternatively, the user can use similar steps to upgrade the subscriber first, followed by the publisher. 上記の手順では、パブリッシャーが最初にアップグレードされ、次にサブスクライバーがアップグレードされます。 または、同様の手順を使用して、まずサブスクライバーをアップグレードし、次にパブリッシャーをアップグレードすることもできます。

29.13.3.2. カスケード論理レプリケーションクラスタをアップグレードする手順 #

<title>Steps to Upgrade a Cascaded Logical Replication Cluster</title>

Let's say we have a cascaded logical replication setup <literal>node1</literal>-><literal>node2</literal>-><literal>node3</literal>. Here <literal>node2</literal> is subscribing the changes from <literal>node1</literal> and <literal>node3</literal> is subscribing the changes from <literal>node2</literal>. The <literal>node2</literal> has a subscription <literal>sub1_node1_node2</literal> which is subscribing the changes from <literal>node1</literal>. The <literal>node3</literal> has a subscription <literal>sub1_node2_node3</literal> which is subscribing the changes from <literal>node2</literal>. カスケードされた論理レプリケーションセットアップnode1->node2->node3があるとします。 ここで、node2node1からの変更をサブスクライブしており、node3node2からの変更をサブスクライブしています。 node2にはnode1からの変更をサブスクライブしているsub1_node1_node2サブスクリプションがあります。 node3にはnode2からの変更をサブスクライブしているsub1_node2_node3サブスクリプションがあります。 node3

  1. Disable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... DISABLEを使用して、node1からの変更をサブスクライブしているnode2上のすべてのサブスクリプションを無効にします。以下は、その例です。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 DISABLE;
    

  2. Stop the server in <literal>node1</literal>, e.g.: node1にあるサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data1 stop
    

  3. Initialize <literal>data1_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data1_upgradedインスタンスを初期化します。

  4. Upgrade the <literal>node1</literal>'s server to the required newer version, e.g.: 必要とされる新しいバージョンを使用して、node1にあるサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data1"
            --new-datadir "/opt/PostgreSQL/postgres/18/data1_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  5. Start the upgraded server in <literal>node1</literal>, e.g.: node1にあるアップグレードされたサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data1_upgraded start -l logfile
    

  6. Disable all the subscriptions on <literal>node3</literal> that are subscribing the changes from <literal>node2</literal> by using <link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... DISABLEを使用して、node2からの変更をサブスクライブしているnode3上のすべてのサブスクリプションを無効にします。

    /* node3 # */ ALTER SUBSCRIPTION sub1_node2_node3 DISABLE;
    

  7. Stop the server in <literal>node2</literal>, e.g.: node2にあるサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data2 stop
    

  8. Initialize <literal>data2_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data2_upgradedインスタンスを初期化します。

  9. Upgrade the <literal>node2</literal>'s server to the required new version, e.g.: 必要とされる新しいバージョンを使用して、node2にあるサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data2"
            --new-datadir "/opt/PostgreSQL/postgres/18/data2_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  10. Start the upgraded server in <literal>node2</literal>, e.g.: node2にあるアップグレードされたサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile
    

  11. On <literal>node2</literal>, create any tables that were created in the upgraded publisher <literal>node1</literal> server between <xref linkend="cascaded-cluster-disable-sub-node1-node2"/> and now, e.g.: node2上で、ステップ 1と現在までの間に、パブリッシャーサーバnode1で作成されたすべてのテーブルを作成します。

    /* node2 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
    

  12. Enable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... ENABLEコマンドを使用して、node1からの変更をサブスクライブするnode2上のすべてのサブスクリプションを有効にします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 ENABLE;
    

  13. Refresh the <literal>node2</literal> subscription's publications using <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>, e.g.: ALTER SUBSCRIPTION ... REFRESH PUBLICATIONコマンドを使用して、node2サブスクリプションのパブリケーションをリフレッシュします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 REFRESH PUBLICATION;
    

  14. Stop the server in <literal>node3</literal>, e.g.: node3にあるサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data3 stop
    

  15. Initialize <literal>data3_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data3_upgradedインスタンスを初期化します。

  16. Upgrade the <literal>node3</literal>'s server to the required new version, e.g.: 必要とされる新しいバージョンを使用して、node3にあるサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data3"
            --new-datadir "/opt/PostgreSQL/postgres/18/data3_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  17. Start the upgraded server in <literal>node3</literal>, e.g.: node3にあるアップグレードされたサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data3_upgraded start -l logfile
    

  18. On <literal>node3</literal>, create any tables that were created in the upgraded <literal>node2</literal> between <xref linkend="cascaded-cluster-disable-sub-node2-node3"/> and now, e.g.: node3上で、ステップ 6と現在までの間に、パブリッシャーサーバnode2で作成されたすべてのテーブルを作成します。

    /* node3 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
    

  19. Enable all the subscriptions on <literal>node3</literal> that are subscribing the changes from <literal>node2</literal> by using <link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... ENABLEコマンドを使用して、node2からの変更をサブスクライブするnode3上のすべてのサブスクリプションを有効にします。

    /* node3 # */ ALTER SUBSCRIPTION sub1_node2_node3 ENABLE;
    

  20. Refresh the <literal>node3</literal> subscription's publications using <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>, e.g.: ALTER SUBSCRIPTION ... REFRESH PUBLICATIONコマンドを使用して、node3サブスクリプションのパブリケーションをリフレッシュします。

    /* node3 # */ ALTER SUBSCRIPTION sub1_node2_node3 REFRESH PUBLICATION;
    

29.13.3.3. 2ノードの循環論理レプリケーションクラスタをアップグレードする手順 #

<title>Steps to Upgrade a Two-node Circular Logical Replication Cluster</title>

Let's say we have a circular logical replication setup <literal>node1</literal>-><literal>node2</literal> and <literal>node2</literal>-><literal>node1</literal>. Here <literal>node2</literal> is subscribing the changes from <literal>node1</literal> and <literal>node1</literal> is subscribing the changes from <literal>node2</literal>. The <literal>node1</literal> has a subscription <literal>sub1_node2_node1</literal> which is subscribing the changes from <literal>node2</literal>. The <literal>node2</literal> has a subscription <literal>sub1_node1_node2</literal> which is subscribing the changes from <literal>node1</literal>. 循環論理レプリケーションセットアップnode1->node2およびnode2->node1があるとします。 ここで、node2node1からの変更をサブスクライブしており、node1node2からの変更をサブスクライブしています。 node1にはnode2からの変更をサブスクライブしているsub1_node2_node1サブスクリプションがあります。 node2にはnode1からの変更をサブスクライブしているsub1_node1_node2サブスクリプションがあります。

  1. Disable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... DISABLEを使用して、node1からの変更をサブスクライブしているnode2上のすべてのサブスクリプションを無効にします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 DISABLE;
    

  2. Stop the server in <literal>node1</literal>, e.g.: node1にあるサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data1 stop
    

  3. Initialize <literal>data1_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data1_upgradedインスタンスを初期化します。

  4. Upgrade the <literal>node1</literal>'s server to the required newer version, e.g.: 必要とされる新しいバージョンを使用して、node1にあるサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data1"
            --new-datadir "/opt/PostgreSQL/postgres/18/data1_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  5. Start the upgraded server in <literal>node1</literal>, e.g.: node1にあるアップグレードされたサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data1_upgraded start -l logfile
    

  6. Enable all the subscriptions on <literal>node2</literal> that are subscribing the changes from <literal>node1</literal> by using <link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... ENABLEコマンドを使用して、node1からの変更をサブスクライブするnode2上のすべてのサブスクリプションを有効にします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 ENABLE;
    

  7. On <literal>node1</literal>, create any tables that were created in <literal>node2</literal> between <xref linkend="circular-cluster-disable-sub-node2"/> and now, e.g.: node1上で、ステップ 1と現在までの間に、パブリッシャーサーバnode2で作成されたすべてのテーブルを作成します。

    /* node1 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
    

  8. Refresh the <literal>node1</literal> subscription's publications to copy initial table data from <literal>node2</literal> using <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>, e.g.: ALTER SUBSCRIPTION ... REFRESH PUBLICATIONコマンドを使用して、node1サブスクリプションのパブリケーションをリフレッシュします。

    /* node1 # */ ALTER SUBSCRIPTION sub1_node2_node1 REFRESH PUBLICATION;
    

  9. Disable all the subscriptions on <literal>node1</literal> that are subscribing the changes from <literal>node2</literal> by using <link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... DISABLEを使用して、node2からの変更をサブスクライブしているnode1上のすべてのサブスクリプションを無効にします。

    /* node1 # */ ALTER SUBSCRIPTION sub1_node2_node1 DISABLE;
    

  10. Stop the server in <literal>node2</literal>, e.g.: node2にあるサーバを停止します。

    pg_ctl -D /opt/PostgreSQL/data2 stop
    

  11. Initialize <literal>data2_upgraded</literal> instance by using the required newer version. 必要とされる新しいバージョンを使用して、data2_upgradedインスタンスを初期化します。

  12. Upgrade the <literal>node2</literal>'s server to the required new version, e.g.: 必要とされる新しいバージョンを使用して、node2にあるサーバをアップグレードします。

    pg_upgrade
            --old-datadir "/opt/PostgreSQL/postgres/17/data2"
            --new-datadir "/opt/PostgreSQL/postgres/18/data2_upgraded"
            --old-bindir "/opt/PostgreSQL/postgres/17/bin"
            --new-bindir "/opt/PostgreSQL/postgres/18/bin"
    

  13. Start the upgraded server in <literal>node2</literal>, e.g.: node2にあるアップグレードされたサーバを起動します。

    pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile
    

  14. Enable all the subscriptions on <literal>node1</literal> that are subscribing the changes from <literal>node2</literal> by using <link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>, e.g.: ALTER SUBSCRIPTION ... ENABLEコマンドを使用して、node2からの変更をサブスクライブするnode1上のすべてのサブスクリプションを有効にします。

    /* node1 # */ ALTER SUBSCRIPTION sub1_node2_node1 ENABLE;
    

  15. On <literal>node2</literal>, create any tables that were created in the upgraded <literal>node1</literal> between <xref linkend="circular-cluster-disable-sub-node1"/> and now, e.g.: node2上で、ステップ 9と現在までの間に、パブリッシャーサーバnode1で作成されたすべてのテーブルを作成します。

    /* node2 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
    

  16. Refresh the <literal>node2</literal> subscription's publications to copy initial table data from <literal>node1</literal> using <link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>, e.g.: ALTER SUBSCRIPTION ... REFRESH PUBLICATIONコマンドを使用して、node2サブスクリプションのパブリケーションをリフレッシュします。

    /* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 REFRESH PUBLICATION;