|
109 | 109 | <ul class="current"> |
110 | 110 | <li class="toctree-l2"><a class="reference internal" href="#publications">Publications</a> |
111 | 111 | <ul> |
| 112 | + <li class="toctree-l3"><a class="reference internal" href="#fine-grained-control-over-publication-tables">Fine-grained control over publication tables</a> |
| 113 | + </li> |
112 | 114 | <li class="toctree-l3"><a class="reference internal" href="#required-fields-in-the-publication-manifest">Required Fields in the Publication Manifest</a> |
113 | 115 | </li> |
114 | 116 | <li class="toctree-l3"><a class="reference internal" href="#reconciliation-and-status">Reconciliation and Status</a> |
@@ -431,14 +433,41 @@ <h2 id="publications">Publications</h2> |
431 | 433 | <li>It includes all tables (<code>spec.target.allTables: true</code>) from the <code>app</code> |
432 | 434 | database (<code>spec.dbname</code>).</li> |
433 | 435 | </ul> |
| 436 | +<h3 id="fine-grained-control-over-publication-tables">Fine-grained control over publication tables</h3> |
| 437 | +<p>While the <code>allTables</code> option provides a convenient way to replicate all tables |
| 438 | +in a database, PostgreSQL version 15 and later introduce enhanced flexibility |
| 439 | +through the <a href="https://www.postgresql.org/docs/current/sql-createpublication.html"><code>CREATE PUBLICATION</code></a> |
| 440 | +command. This allows you to precisely define which tables, or even which types |
| 441 | +of data changes, should be included in a publication.</p> |
434 | 442 | <div class="admonition important"> |
435 | 443 | <p class="admonition-title">Important</p> |
436 | | -<p>While <code>allTables</code> simplifies configuration, PostgreSQL offers fine-grained |
437 | | -control for replicating specific tables or targeted data changes. For advanced |
438 | | -configurations, consult the <a href="https://www.postgresql.org/docs/current/logical-replication.html">PostgreSQL documentation</a>. |
439 | | -Additionally, refer to the <a href="../cloudnative-pg.v1/#postgresql-cnpg-io-v1-PublicationTarget">CloudNativePG API reference</a> |
440 | | -for details on declaratively customizing replication targets.</p> |
| 444 | +<p>If you are using PostgreSQL versions earlier than 15, review the syntax and |
| 445 | +options available for <code>CREATE PUBLICATION</code> in your specific release. Some |
| 446 | +parameters and features may not be supported.</p> |
441 | 447 | </div> |
| 448 | +<p>For complex or tailored replication setups, refer to the |
| 449 | +<a href="https://www.postgresql.org/docs/current/logical-replication.html">PostgreSQL logical replication documentation</a>.</p> |
| 450 | +<p>Additionally, refer to the <a href="../cloudnative-pg.v1/#postgresql-cnpg-io-v1-PublicationTarget">CloudNativePG API reference</a> |
| 451 | +for details on declaratively customizing replication targets.</p> |
| 452 | +<p>The following example defines a publication that replicates all tables in the |
| 453 | +<code>portal</code> schema of the <code>app</code> database, along with the <code>users</code> table from the |
| 454 | +<code>access</code> schema:</p> |
| 455 | +<pre><code class="language-yaml">apiVersion: postgresql.cnpg.io/v1 |
| 456 | +kind: Publication |
| 457 | +metadata: |
| 458 | + name: publisher |
| 459 | +spec: |
| 460 | + cluster: |
| 461 | + name: freddie |
| 462 | + dbname: app |
| 463 | + name: publisher |
| 464 | + target: |
| 465 | + objects: |
| 466 | + - tablesInSchema: portal |
| 467 | + - table: |
| 468 | + name: users |
| 469 | + schema: access |
| 470 | +</code></pre> |
442 | 471 | <h3 id="required-fields-in-the-publication-manifest">Required Fields in the <code>Publication</code> Manifest</h3> |
443 | 472 | <p>The following fields are required for a <code>Publication</code> object:</p> |
444 | 473 | <ul> |
@@ -656,7 +685,7 @@ <h3 id="step-1-setting-up-the-publisher-freddie">Step 1: Setting Up the Publishe |
656 | 685 | spec: |
657 | 686 | instances: 1 |
658 | 687 |
|
659 | | - imageName: ghcr.io/cloudnative-pg/postgresql:16 |
| 688 | + imageName: ghcr.io/cloudnative-pg/postgresql:16-standard-trixie |
660 | 689 |
|
661 | 690 | storage: |
662 | 691 | size: 1Gi |
@@ -700,6 +729,8 @@ <h3 id="step-2-setting-up-the-subscriber-king">Step 2: Setting Up the Subscriber |
700 | 729 | spec: |
701 | 730 | instances: 1 |
702 | 731 |
|
| 732 | + imageName: ghcr.io/cloudnative-pg/postgresql:18-standard-trixie |
| 733 | + |
703 | 734 | storage: |
704 | 735 | size: 1Gi |
705 | 736 |
|
|
0 commit comments