]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix planner's row-mark code for inheritance from a foreign table.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Jun 2021 18:38:14 +0000 (14:38 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Jun 2021 18:38:14 +0000 (14:38 -0400)
commit889592344c48d3965567f331b4ea89dfe6447bce
treef55ac29a37cc615bb0b07327f1f9cb1eab42a4f8
parent79c50ca57828e9f8375766b36cce1e2960eebf87
Fix planner's row-mark code for inheritance from a foreign table.

Commit 428b260f8 broke planning of cases where row marks are needed
(SELECT FOR UPDATE, etc) and one of the query's tables is a foreign
table that has regular table(s) as inheritance children.  We got the
reverse case right, but apparently were thinking that foreign tables
couldn't be inheritance parents.  Not so; so we need to be able to
add a CTID junk column while adding a new child, not only a wholerow
junk column.

Back-patch to v12 where the faulty code came in.

Amit Langote

Discussion: https://postgr.es/m/CA+HiwqEmo3FV1LAQ4TVyS2h1WM=kMkZUmbNuZSCnfHvMcUcPeA@mail.gmail.com
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/sql/postgres_fdw.sql
src/backend/optimizer/util/inherit.c