-
Notifications
You must be signed in to change notification settings - Fork 828
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
Support for inline SET — change a run-time parameter #2966
Comments
The issue here is that you cannot execute the SET in an executeQuery() as set does not return anything. You can execute it in execute() then execute the query. It will take two calls though |
I wonder if we can make such behaviour acceptable. I'm not sure it is the best escape hatch, however, I would really like to have something for "select batching" (like We have
The drawback of |
This would sort of play havoc with poolers. If you haven't issued the set before the close you would have to do so on close() This seems pretty hacky Dave |
Hello, I've just submitted a POC to show that the feature won't require a lot of changes in the code. |
saw that, thanks! let's see if it passes the tests |
I'm not able to run the full test suite at the moment, try to find a way to avoid side effects for now... |
@davecramer it's quite difficult to wonder what appends on the CI has I get some test failures on my machine depending on PG version (10 to 12).
Tests result
The failures are both
|
I doubt your PR caused that failure. You can safely ignore that one I think |
Please read https://stackoverflow.com/help/minimal-reproducible-example
Describe the issue
When executing a query preceded by a PostgreSQL SET command
the
executeQuery()
method throws anorg.postgresql.util.PSQLException
: No results were returned by the query, andexecuteUpdate()
returns 0.This behavior is inconsistent and unexpected as the SET command is often used for audit purposes, RLS, etc., and should not interfere with the subsequent query execution.
Driver Version?
42.6.0
Java Version?
21
OS Version?
OSX arm64
PostgreSQL Version?
15.4
To Reproduce
Steps to reproduce the behavior:
Expected behaviour
The SET command should set the session or local configuration parameter as expected and allow the subsequent query to execute normally. executeQuery() and executeUpdate() should work as expected, returning the results or the number of affected rows respectively.
Logs
Using the following template code make sure the bug can be replicated in the driver alone.
The text was updated successfully, but these errors were encountered: