pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Defend against unsupported partition relkind in logical replicat
4+ messages / 1 participants
[nested] [flat]

* pgsql: Defend against unsupported partition relkind in logical replicat
@ 2022-11-02 16:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2022-11-02 16:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Defend against unsupported partition relkind in logical replication worker.

Since partitions can be foreign tables not only plain tables, but
logical replication only supports plain tables, we'd better check the
relkind of a partition after we find it.  (There was some discussion
of checking this when adding a partitioned table to a subscription;
but that would be inadequate since the troublesome partition could be
added later.)  Without this, the situation leads to a segfault or
assertion failure.

In passing, add a separate variable for the target Relation of
a cross-partition UPDATE; reusing partrel seemed mighty confusing
and error-prone.

Shi Yu and Tom Lane, per report from Ilya Gladyshev.  Back-patch
to v13 where logical replication into partitioned tables became
a thing.

Discussion: https://postgr.es/m/6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/414d29a826f3a63fabae5e9ac2eb5b17f03787d8

Modified Files
--------------
src/backend/replication/logical/worker.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defend against unsupported partition relkind in logical replicat
@ 2022-11-02 16:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2022-11-02 16:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Defend against unsupported partition relkind in logical replication worker.

Since partitions can be foreign tables not only plain tables, but
logical replication only supports plain tables, we'd better check the
relkind of a partition after we find it.  (There was some discussion
of checking this when adding a partitioned table to a subscription;
but that would be inadequate since the troublesome partition could be
added later.)  Without this, the situation leads to a segfault or
assertion failure.

In passing, add a separate variable for the target Relation of
a cross-partition UPDATE; reusing partrel seemed mighty confusing
and error-prone.

Shi Yu and Tom Lane, per report from Ilya Gladyshev.  Back-patch
to v13 where logical replication into partitioned tables became
a thing.

Discussion: https://postgr.es/m/6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a5b7821fc908b50ace1cdc3b972da08a265a81bd

Modified Files
--------------
src/backend/replication/logical/worker.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defend against unsupported partition relkind in logical replicat
@ 2022-11-02 16:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2022-11-02 16:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Defend against unsupported partition relkind in logical replication worker.

Since partitions can be foreign tables not only plain tables, but
logical replication only supports plain tables, we'd better check the
relkind of a partition after we find it.  (There was some discussion
of checking this when adding a partitioned table to a subscription;
but that would be inadequate since the troublesome partition could be
added later.)  Without this, the situation leads to a segfault or
assertion failure.

In passing, add a separate variable for the target Relation of
a cross-partition UPDATE; reusing partrel seemed mighty confusing
and error-prone.

Shi Yu and Tom Lane, per report from Ilya Gladyshev.  Back-patch
to v13 where logical replication into partitioned tables became
a thing.

Discussion: https://postgr.es/m/6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4d3f7e75c8a37a978cbeabf8e5a8b38d976c23ba

Modified Files
--------------
src/backend/replication/logical/worker.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Defend against unsupported partition relkind in logical replicat
@ 2022-11-02 16:29  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2022-11-02 16:29 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Defend against unsupported partition relkind in logical replication worker.

Since partitions can be foreign tables not only plain tables, but
logical replication only supports plain tables, we'd better check the
relkind of a partition after we find it.  (There was some discussion
of checking this when adding a partitioned table to a subscription;
but that would be inadequate since the troublesome partition could be
added later.)  Without this, the situation leads to a segfault or
assertion failure.

In passing, add a separate variable for the target Relation of
a cross-partition UPDATE; reusing partrel seemed mighty confusing
and error-prone.

Shi Yu and Tom Lane, per report from Ilya Gladyshev.  Back-patch
to v13 where logical replication into partitioned tables became
a thing.

Discussion: https://postgr.es/m/6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/be541efbfd11c4339222935899989d9c65737ac6

Modified Files
--------------
src/backend/replication/logical/worker.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2022-11-02 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 16:29 pgsql: Defend against unsupported partition relkind in logical replicat Tom Lane <tgl@sss.pgh.pa.us>
2022-11-02 16:29 pgsql: Defend against unsupported partition relkind in logical replicat Tom Lane <tgl@sss.pgh.pa.us>
2022-11-02 16:29 pgsql: Defend against unsupported partition relkind in logical replicat Tom Lane <tgl@sss.pgh.pa.us>
2022-11-02 16:29 pgsql: Defend against unsupported partition relkind in logical replicat Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox