postgresql/src/include/replication
Tomas Vondra 923def9a53 Allow specifying column lists for logical replication
This allows specifying an optional column list when adding a table to
logical replication. The column list may be specified after the table
name, enclosed in parentheses. Columns not included in this list are not
sent to the subscriber, allowing the schema on the subscriber to be a
subset of the publisher schema.

For UPDATE/DELETE publications, the column list needs to cover all
REPLICA IDENTITY columns. For INSERT publications, the column list is
arbitrary and may omit some REPLICA IDENTITY columns. Furthermore, if
the table uses REPLICA IDENTITY FULL, column list is not allowed.

The column list can contain only simple column references. Complex
expressions, function calls etc. are not allowed. This restriction could
be relaxed in the future.

During the initial table synchronization, only columns included in the
column list are copied to the subscriber. If the subscription has
several publications, containing the same table with different column
lists, columns specified in any of the lists will be copied.

This means all columns are replicated if the table has no column list
at all (which is treated as column list with all columns), or when of
the publications is defined as FOR ALL TABLES (possibly IN SCHEMA that
matches the schema of the table).

For partitioned tables, publish_via_partition_root determines whether
the column list for the root or the leaf relation will be used. If the
parameter is 'false' (the default), the list defined for the leaf
relation is used. Otherwise, the column list for the root partition
will be used.

Psql commands \dRp+ and \d <table-name> now display any column lists.

Author: Tomas Vondra, Alvaro Herrera, Rahila Syed
Reviewed-by: Peter Eisentraut, Alvaro Herrera, Vignesh C, Ibrar Ahmed,
Amit Kapila, Hou zj, Peter Smith, Wang wei, Tang, Shi yu
Discussion: https://postgr.es/m/CAH2L28vddB_NFdRVpuyRBJEBWjz4BSyTB=_ektNRH8NJ1jf95g@mail.gmail.com
2022-03-26 01:01:27 +01:00
..
backup_manifest.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
basebackup.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
basebackup_sink.h Replace BASE_BACKUP COMPRESSION_LEVEL option with COMPRESSION_DETAIL. 2022-03-23 09:19:14 -04:00
basebackup_target.h Allow extensions to add new backup targets. 2022-03-15 13:22:04 -04:00
decode.h Logical decoding of sequences 2022-02-10 18:43:51 +01:00
logical.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicallauncher.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicalproto.h Allow specifying column lists for logical replication 2022-03-26 01:01:27 +01:00
logicalrelation.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
logicalworker.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
message.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
origin.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
output_plugin.h Logical decoding of sequences 2022-02-10 18:43:51 +01:00
pgoutput.h Add decoding of sequences to built-in replication 2022-03-24 18:49:27 +01:00
reorderbuffer.h Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
slot.h Move replication slot release to before_shmem_exit(). 2022-02-14 17:08:17 -08:00
snapbuild.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
syncrep.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walreceiver.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walsender.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
walsender_private.h Fix limitations on what SQL commands can be issued to a walsender. 2022-01-24 15:33:38 -05:00
worker_internal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00