public inbox for [email protected]
help / color / mirror / Atom feedFrom: Laurenz Albe <[email protected]>
To: 王 博 <[email protected]>
To: [email protected] <[email protected]>
Cc: 李 浩 <[email protected]>
Subject: Re: Request for official clarification on SQL parameter parsing changes in PostgreSQL 15 and 16
Date: Thu, 17 Apr 2025 15:41:19 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <TYCP286MB3620D4D19E3793CFA106CCBFB6BC2@TYCP286MB3620.JPNP286.PROD.OUTLOOK.COM>
References: <TYCP286MB3620D4D19E3793CFA106CCBFB6BC2@TYCP286MB3620.JPNP286.PROD.OUTLOOK.COM>
On Thu, 2025-04-17 at 05:17 +0000, 王 博 wrote:
> We have encountered unexpected SQL parsing errors during application upgrades from
> PostgreSQL 14 to 15 and 16, related to the use of JDBC-style parameter
> placeholders (`?`) in our legacy applications.
>
> Specifically:
>
> 1. In PostgreSQL 15 and later:
> The following SQL causes a syntax error unless a space is added after the `?`:
> SELECT * FROM table WHERE a = ?AND b = 123;
> → Adding a space (`? AND`) resolves the issue.
> This did not cause an error in PostgreSQL 14.
>
> 2. In PostgreSQL 16:
> The following SQL causes a syntax error:
> SELECT * FROM table WHERE a = ?ORDER BY b;
> → This query runs in PostgreSQL 15, but causes an error in 16 unless a space is added after `?`.
>
> We understand that this behavior may stem from changes to the parser to make it more
> strict and SQL-compliant. However, we were unable to find any explicit mention of these
> changes in the official release notes of PostgreSQL 15 or 16.
>
> Our client is asking for official documentation or a statement confirming whether this
> behavior change was intentional and when it was introduced.
>
> Could anyone kindly point us to:
> - Relevant release note sections, commits, or discussions on this change
> - Confirmation that these are intentional parser changes (and not regressions)
I'd say it is this change:
https://postgr.es/c/2549f0661bd28571d7200d6f82f752a7ee5d47e1
The mailing list discussion is here:
https://www.postgresql.org/message-id/flat/[email protected]
Yours,
Laurenz Albe
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Request for official clarification on SQL parameter parsing changes in PostgreSQL 15 and 16
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox