-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
PostgreSQL mode: STRING_AGG with prepared statement parameter not working #3619
Comments
This issue appears because PostgreSQL-specific |
Thanks, for the fast reply. I just had a short look into the code, to check if I could provide a PR for this. But it looks like there is currently no aggregate function that supports JDBC parameters, so it will be a larger change. Am I right? |
Almost all of them support any expressions including parameters. In H2, unlike in the most of JDBC drivers, parameters are special kind of expressions. But |
Thanks for the fast fix. Is there any schedule for the next release that will contain this fix? |
In version 2 of the h2 database it's not possible anymore to use a prepared statement parameter for the separator of the
STRING_AGG
function (PostgreSQL mode).In version 1 you could do the following:
and you will receive a result that will look like this:
If you do the same with version 2 of the h2 database, the result looks like this:
So somehow the comma gets lost in the prepared statement. If you don't use a prepared statement parameter for the separator but set it fixed to statement (
string_agg(t2.value, ',')
) you will receive the correct result. So in general theSTRING_AGG
function in the PostgresSQL mode seems to work.The text was updated successfully, but these errors were encountered: