-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Brackets used in RETURNING keyword can cause issues #541
Comments
This was referenced Oct 5, 2020
Merged
Merged
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Oct 6, 2020
* updated documentation to remove the parenthesis around the return value from the insert query to reinforce the idea of only one value being returned Signed-off-by:Nathan Erwin <nathan.d.erwin@gmail.com>
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Oct 6, 2020
* updated documentation to remove the parenthesis around the return value from the insert query to reinforce the idea of only one value being returned Signed-off-by:Nathan Erwin <nathan.d.erwin@gmail.com>
@gsmet This one can be closed now since the PRs are merged. Maybe I didn't link them correctly so that it was automatically closed. |
Closing, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quarkus-quickstarts/getting-started-reactive-crud/src/main/java/org/acme/reactive/crud/Fruit.java
Line 60 in 375d533
The PostgreSQL documentation for use of the
RETURNING
clause does not indicate that brackets should surround column names in the clause. This only appears to work Ok when returning a single value as in this example. WhenRETURNING
multiple columns it causes all values to be returned as a single bracketed string.For example,
RETURNING (id, name)
would return a single column namedrow
with the string value"(1, Kiwi)"
, causingrow.getLong("id")
orrow.getString("name")
to returnnull
.I would suggest removing the brackets at per PostgreSQL documentation to avoid developers making the mistake of bracketing multiple return values and falling in to this trap.
The Getting Started guide should also be updated if this change is made.
The text was updated successfully, but these errors were encountered: