You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kyleconroy This change is intentional - that was always a libpg_query patch, Postgres never supported this syntax for parameter references. Though some ORMs support ? replacement characters, they then do local substitution and don't send the query in that form to the Postgres server.
The motivation for having this modified parser grammar in pg_query to begin with was that we wanted to be able to read the query texts produced by pg_stat_statements, which prior to Postgres 10 used ? (see the commit that changes this for reference).
Since those Postgres versions have reached end of life for over a year now, we decided to drop support for ? replacement characters, which also solves a few edge cases where it caused problems with operators containing ? (see e.g. pganalyze/libpg_query#132)
It sounds like this might be a problem for sqlc. Can you describe a bit more the use case for using ?? (are you doing local substitution of the values before sending them to Postgres?)
Postgres never supported this syntax for parameter references
Okay, that's great news. sqlc does not do the parameter re-writing, so this shouldn't be a breaking change for users. While the parser allowed those placeholders, those queries never would have worked in the first place.
In the process of upgrading from v2 to v4 (sqlc-dev/sqlc#2114) I discovered a breaking change. In v2, the following query parses without an error:
However, in v4, this same query now returns a syntax error.
Is this a PostgreSQL change or pg_query_go change?
A full reproduction here: https://gist.github.com/kyleconroy/792b77389287f34a501e572b6c7281df
The text was updated successfully, but these errors were encountered: