Implement new PostgreSQL 15 features in publication dialog and SQL. #5868

This commit is contained in:
Anil Sahoo
2023-05-25 16:25:12 +05:30
committed by GitHub
parent 702bc8c8ce
commit 8b7eeca545
91 changed files with 3105 additions and 202 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -6,9 +6,9 @@
`Logical replication <https://www.postgresql.org/docs/13/logical-replication.html>`_ uses a *publish* and *subscribe* model with one or more *subscribers* subscribing to one or more *publications* on a publisher node.
Use the *publication* dialog to create a publication. 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.
Use the *publication* dialog to create a publication. A publication is a set of changes generated from a table or a group of tables or a schema or a group of schemas, and might also be described as a change set or replication set.
The *publication* dialog organizes the development of a publication through the following dialog tabs: *General* and *Definition*. The *SQL* tab displays the SQL code generated by dialog selections.
The *publication* dialog organizes the development of a publication through the following dialog tabs: *General* and *Definition*. The *SQL* tab displays the SQL code generated by dialog selections. In place of *Definition* tab *Tables* and *Options* tab will come for PostgreSQL version >= 15.
.. image:: images/publication_general.png
:alt: Publication dialog general tab
@@ -32,6 +32,32 @@ Use the *Definition* tab to set properties for the publication:
* Specify a table or list of tables separated by a comma in *Tables* field to replicate all the listed table.
* Use the *With* section to determine which DML operations will be published by the new publication to the subscribers. Move the switch next to *INSERT*, *UPDATE*, *DELETE*, or *TRUNCATE* to *No* if you do not want to replicate any of these DML operations from Publication to Subscription. By default, all the switches are set to *Yes* allowing all the DML operations.
With PostgreSQL 15 forward, the *Tables* and *Options* tab will be visible.
Click the *Tables* tab to continue.
.. image:: images/publication_tables.png
:alt: Publication dialog tables tab
:align: center
Use the *Tables* tab to set table properties for the publication:
* Move the switch next to *All tables?* to *Yes* to replicate all the tables of the database, including tables created in the future.
* Move the switch next to *Only table?* to *Yes* to replicate only the listed tables excluding all its descendant tables.
* Specify a schema or list of schemas separated by a comma in *Tables In Schema* field to replicate all the listed schemas. This field will be disabled if any columns are selected for tables in subsequent field.
* Specify a table or list of tables to replicate all the listed table along with specific columns and/or WHERE clause to filter rows.
Click the *Options* tab to continue.
.. image:: images/publication_options.png
:alt: Publication dialog options tab
:align: center
Use the *Options* tab to set option properties for the publication:
* Use the *With* section to determine which DML operations will be published by the new publication to the subscribers. Move the switch next to *INSERT*, *UPDATE*, *DELETE*, or *TRUNCATE* to *No* if you do not want to replicate any of these DML operations from Publication to Subscription. By default, all the switches are set to *Yes* allowing all the DML operations.
.. note:: A published table must have a “replica identity” configured in order to be able to replicate UPDATE and DELETE operations. You can change with ALTER TABLE statement. For more information on replica identity see `Logical Replication Publication <https://www.postgresql.org/docs/13/logical-replication-publication.html>`_.
Click the *SQL* tab to continue.
@@ -44,7 +70,7 @@ The following is an example of the sql command generated by user selections in
the *Publication* dialog:
.. image:: images/publication_sql.png
:alt: Publication dialog sql tab
:alt: Publication dialog sql tab for PostgreSQL version <= 14
:align: center
The example creates a publication named *pub1* that is owned by *postgres*. It