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
Correction of multiline UPDATE statements in the Postgres driver #2629
Conversation
…L database driver
The feature is provided by the PostgreSQL engine, and it would be great to be able to use this feature without any hack in CI. Source: |
Nice one, although it needs some additional work:
|
I do hope, that I could accomplish everything properly. By the way; there is no REPLACE statement in the PostgreSQL. |
i hope everything is right now |
So, you're telling me that you can do something like this?
This seems quite odd to me. :) |
Well, the set part might make no sense with your example, but if you work with multi-line queries it can be quite annoying that the SET keyword turns the query to a non-reading type. The example of @fema90 shows exactly the problem. Look at the second line; that SET there would break the whole query, and the result would be that you have no result, but that the query went well. Thats not what I want in such a case. I hope this explains my step. :) |
So I think the current solution fits everything, except what you've mentioned (to be honest I don't really understand what you've meant, with the PR, I hope that is not too much). |
An improved version of PR #2629. Also removes REPLACE from the regular expression, as it is not supported by PostgreSQL.
@fema90's example shows an UPDATE query, the regular expression that I asked you about would validate a query that bebings with a SET. The one now, after your last commit is even messier. :) See the above commit for the cleaner way. Sorry for making you add a changelog entry btw, I just realized it was the same bug that was fixed for INSERT, so no need to have 2 lines in there. |
Well, this does not solve the base problem (at least not "mine"), but maybe I just don't understand something, and maybe its off topic: In the Postgres community (as it is in the Oracle and in the MsSQL) its common practice to write long queries, and for readability these are split into multiple lines. So wouldn't it make sense to support this practice, or is it considered as wrong? I'm just asking right now. |
The good old PCRE ignoring everything after the newline character, even without the 'm' modifier ... should be OK now. :) |
Added support for returning values in multi-line UPDATE query statements to the PostgreSQL database driver