-
Notifications
You must be signed in to change notification settings - Fork 47
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
Escape double '??' to a literal '?' #5
Conversation
This change makes it possible to use literal question marks in queries to PostgreSQL. This is needed to be able to use the new JSON operators. https://www.postgresql.org/docs/9.5/static/functions-json.html This change can't break anything, since: * Anyone using double question marks would get an error if not supplied the adequate amount of accompanying values (in case of people trying the new JSON operators); or * If supplied the adequate amount of accompanying values, PostgreSQL would throw a fit because you'd supply two values directly next to each other, which doesn't make sense.
I'm suspecting this travis build also uses PostgreSQL 9.3 or less. |
… Sent from my iPhone
On 1 Feb 2019, at 14.49, Felix Paulusma ***@***.***> wrote:
I'm suspecting this travis build also uses PostgreSQL 9.3 or less.
I'm not sure how to change which version of PostgreSQL is used by the Travis build. Help would be appreciated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yet, ?? Escaping can be test insite string literal, can't it?
…Sent from my iPhone
On 1 Feb 2019, at 23.05, Oleg Grenrus ***@***.***> wrote:
https://docs.travis-ci.com/user/database-setup/#using-a-different-postgresql-version
Sent from my iPhone
> On 1 Feb 2019, at 14.49, Felix Paulusma ***@***.***> wrote:
>
> I'm suspecting this travis build also uses PostgreSQL 9.3 or less.
> I'm not sure how to change which version of PostgreSQL is used by the Travis build. Help would be appreciated.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
|
…literal (byte)string
Ok, everything should be ready to merge. Do I have to add something to the |
I've added a test that just uses the function that escapes double question marks and breaks on single ones on a regular (byte)string, for completeness. The other tests I already put in there make sure the question mark operators behave as expected and that double ?? do indeed turn into something PostgreSQL can use for JSON operations. |
Any idea if/when this will be merged? |
I'm steadily working through issues
…Sent from my iPhone
On 21 Feb 2019, at 20.50, Felix Paulusma ***@***.***> wrote:
Any idea if/when this will be merged?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
squashed in #8 |
This was already a pull request in lpsmith's repo, but now moved here.
This change seeks to allow for the usage of the JSON operators new to PostgreSQL since version 9.4 that use a question mark (namely:
?
,?|
and?&
) by way of escaping double question marks to a literal question mark in the resulting query.This shouldn't break any existing code, since any occurrence of double question marks of which none are to be replaced by a value would be an error in any pre-existing code.