pgsql: Disallow MERGE cleanly for foreign partitions

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow MERGE cleanly for foreign partitions
Date: 2022-10-15 18:23:27
Message-ID: E1ojlol-002W1r-9e@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow MERGE cleanly for foreign partitions

While directly targetting a foreign table with MERGE was already
expressly forbidden, we failed to catch the case of a partitioned table
that has a foreign table as a partition; and the result if you try is an
incomprehensible error. Fix that by adding a specific check.

Backpatch to 15.

Reported-by: Tatsuhiro Nakamori <bt22nakamorit(at)oss(dot)nttdata(dot)com>
Discussion: https://postgr.es/m/bt22nakamorit@oss.nttdata.com

Branch
------
master

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

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 5 +++++
contrib/postgres_fdw/sql/postgres_fdw.sql | 4 ++++
src/backend/optimizer/plan/createplan.c | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-10-15 20:04:41 pgsql: meson: catch up to a few configure changes
Previous Message Michael Paquier 2022-10-15 03:22:58 pgsql: Fix some comments in proc.h