Prepare to support non-tables in publications
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 19 Mar 2020 07:17:50 +0000 (08:17 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 19 Mar 2020 07:25:07 +0000 (08:25 +0100)
commitc314c147c0563c9758bdad988ffda8d64daa2db6
treef4d6f667e968a47bb9c73ac3803360063405e8b3
parent1d253bae57fcb3e75cdd9cdb2592c5b09cf7e7b7
Prepare to support non-tables in publications

This by itself doesn't change any functionality but prepares the way
for having relations other than base tables in publications.

Make arrangements for COPY handling the initial table sync.  For
non-tables we have to use COPY (SELECT ...) instead of directly
copying from the table, but then we have to take care to omit
generated columns from the column list.

Also, remove a hardcoded reference to relkind = 'r' and rely on the
publisher to send only what it can actually publish, which will be
correct even in future cross-version scenarios.

Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+HiwqH=Y85vRK3mOdjEkqFK+E=ST=eQiHdpj43L=_eJMOOznQ@mail.gmail.com
src/backend/replication/logical/tablesync.c
src/include/replication/logicalproto.h