]> granicus.if.org Git - postgresql/commit
Fix table syncing with different column order
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 18 May 2017 18:16:16 +0000 (14:16 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 24 May 2017 23:40:30 +0000 (19:40 -0400)
commit073ce405d68355eed36a11b41e558232ecf18201
tree3bd3cd34873e57e0d1d147078a479642256d0d03
parent92ecb148e517704ec945dce513db71fee7790cfd
Fix table syncing with different column order

Logical replication supports replicating between tables with different
column order.  But this failed for the initial table sync because of a
logic error in how the column list for the internal COPY command was
composed.  Fix that and also add a test.

Also fix a minor omission in the column name mapping cache.  When
creating the mapping list, it would not skip locally dropped columns.
So if a remote column had the same name as a locally dropped
column (...pg.dropped...), then the expected error would not occur.
src/backend/replication/logical/relation.c
src/backend/replication/logical/tablesync.c
src/test/subscription/t/001_rep_changes.pl