]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Remove unreachable error check in JSON_TABLE plan transform
authorAlexander Korotkov <akorotkov@postgresql.org>
Tue, 14 Jul 2026 21:48:07 +0000 (00:48 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Tue, 14 Jul 2026 21:48:07 +0000 (00:48 +0300)
commit9ee5241d02442911ffec9a0ce35327a0fea4a5c1
tree765fec5da97df094bc22dd58c3cf95c9ac91c331
parent6d8fd5a88183a65e77308aff374ebc239c44c6af
Remove unreachable error check in JSON_TABLE plan transform

transformJsonTableNestedColumns() looked up the nested column named by a
JSON_TABLE PLAN node and raised "invalid JSON_TABLE plan clause / PATH
name was %s not found in nested columns list" if none was found.  That
lookup cannot fail: validateJsonTableChildPlan() runs first, at every
plan level, and already matches the plan's sibling path names one-to-one
against the nested columns (reporting any uncovered nested path or any
extra or duplicate sibling node).  The check has been unreachable since
the PLAN clause code was first written.

Replace it with an Assert documenting the invariant, which also removes
a user-facing message that could never be emitted.

Reported-by: Thom Brown <thom@linux.com>
Discussion: https://postgr.es/m/CAA-aLv5_9%3DzgA_Y7aoFp-%2BQSeh0kx4dfbAas9Wx%3DyrweQSqa6Q%40mail.gmail.com
src/backend/parser/parse_jsontable.c