-
Notifications
You must be signed in to change notification settings - Fork 176
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
Postgres function calls do not work any more for postgres versions < 17. #2369
Comments
To @chicko12345 @rdicroce |
I'm not an expert on PG. My company just started using it, and I've since been pulled off to work on other things. But I know that stored function != stored procedure in PG, and you can't call them the same way. IIRC for stored procs, you need to do what my patch does. For stored funcs, you need to use SELECT. |
sorry for the late answer! That was a weird one. :-D! We found it. Both works on postgresql 16.6 with eclipselink 4.0.4 IF AND ONLY IF following setting is set: With eclipselink 4.0.5 it doesn't work any more. If the commit is reverted as already described, it works again. Update:
Kind Regards |
I am not surprised that named params do not work without that setting, because pgjdbc does not natively support named params. See pgjdbc/pgjdbc#2486. Is UPDATE_GROUP a stored function or a stored procedure? Again, those are different things in PG. Calling a procedure should be fine with my patch. If calling a function as if it were a procedure happened to work in 4.0.4 and doesn't in 4.0.5, then IMO that was undocumented behavior, and I'd suggest changing your code to do |
HI @rdicroce, thanks for the quick response. UPDATE_GROUP is a function. I've created it for testing purposes only and the calls work until eclipselink 4.0.4. We are aware of the difference between procedures and functions. There is a function which was called in the manner i've described since it was introduced. It woked from glassfish 5.0.1 (eclipselink 2.7.X) to glassfish 7.0.21 (eclipselink 4.0.3). During the tests on glassfish 7.0.22 (eclipselink 4.0.5) we had to deal with the problem for the first time . We know, that the function isn't an appropriate construct here to be called in that way. However, we wanted to understand the reason, why it was even possible. So yes, it was with high probability just a side effect of eclipselink with logically unexpected (but in our case practically right :-)) behavior. Kind Regards |
I also have problems calling stored procedures with 4.0.5. With 4.0.4 I could call a PostgreSQL function With 4.0.5 I can call a PostgreSQL stored procedure
Postgresql Needs I adapted Is there a chance to fix this bug? |
Hi Community,
the change introduced by
#2308
leads to unexpected behavior in our environment. Postgres functions cannot be triggered as it was in eclipselink 4.0.4
The commit removes specific handling of postgres function calls which seem to be necessary for postgres versions < 17.
Local revert of:
This reverts commit 452ffdd.
fixes the problem.
Our environment:
To Reproduce
If a postgres function is defined
Both following versions of the function call throw SQL Exceptions:
The text was updated successfully, but these errors were encountered: