Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queries with question mark placeholders (?) not valid anymore #41

Open
valichek opened this issue Aug 21, 2024 · 1 comment
Open

Queries with question mark placeholders (?) not valid anymore #41

valichek opened this issue Aug 21, 2024 · 1 comment

Comments

@valichek
Copy link
Contributor

valichek commented Aug 21, 2024

Queries with (?) are not valid since updated version from 1.1.6 to 1.1.7/1.1.8, doesn't depend on go version

SELECT id FROM my_table WHERE id IN (?);

Getting ERROR: syntax error at or near ")"

Another example:

SELECT * FROM my_table WHERE id = ? AND user_id IN (?);

Getting ERROR: syntax error at or near "AND"

@valichek valichek changed the title Select queries with (?) not valid Queries with (?) not valid Aug 21, 2024
@valichek
Copy link
Contributor Author

valichek commented Aug 22, 2024

relates to pganalyze/pg_query_go#78

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.

@houqp not sure if need to fix this

@valichek valichek changed the title Queries with (?) not valid Queries with question mark placeholders (?) not valid anymore Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant