pgsql: Fix empty FOREIGN_JOIN sublist validation

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix empty FOREIGN_JOIN sublist validation
Date: 2026-08-27 18:46:15
Message-ID: E1wzf78-00000002NXG-1rh6@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix empty FOREIGN_JOIN sublist validation

FOREIGN_JOIN target sublists must contain at least two relation
identifiers. However, the parser checked only for sublists with
exactly one identifier, so FOREIGN_JOIN(()) was accepted.

Reject sublists with fewer than two relation identifiers, and add
regression coverage.

Author: Chao Li <lic(at)highgo(dot)com>
Discussion: http://postgr.es/m/BEDC04E0-6732-4310-95BA-6EC34BC1442C@gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/400c810ddbd7890f751913977e4442d71a0ebfc4

Modified Files
--------------
contrib/pg_plan_advice/expected/syntax.out | 3 +++
contrib/pg_plan_advice/pgpa_parser.y | 2 +-
contrib/pg_plan_advice/sql/syntax.sql | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-08-27 19:11:16 pgsql: pg_upgrade: Read nextMultiOffset as a 64-bit value.
Previous Message Fujii Masao 2026-08-27 16:19:24 pgsql: Fix temporary WAL receiver slot handling on timeline switches