Re: Problems with question marks in operators (JDBC, ECPG, ...) - Mailing list pgsql-hackers

From Bruno Harbulot
Subject Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date
Msg-id CANPVNBaU6ik_EYMxEWL_yJ7TYZiVVs46kO6H+2qdzBs_ZBcmZA@mail.gmail.com
Whole thread Raw
In response to Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Kevin Grittner <kgrittn@ymail.com>)
Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, May 15, 2015 at 9:41 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, May 15, 2015 at 4:38 PM, Dave Cramer <pg@fastcrypt.com> wrote:
>> I don't really want to take a violently strong position on this
>> without understanding what's really going on here.
>>
> Well our solution was to use ?? but that does mean we have to do some extra
> parsing which in a perfect world wouldn't be necessary.

So what about strings quoted with '' or $$ or $something$ - how would
you handle those?

I hadn't realised that the JDBC driver allowed the ? operator to be escaped as ??. It seems to work indeed (at least with version 9.4-1201 of the JDBC driver).

$$....?$$ also works. I guess the JDBC drivers tries to parse literals first and escapes them accordingly.

That said, I'd still suggest providing new operators and deprecating the ones containing a question mark if possible. (There are 8 distinct operator names like this: "?-", "?&", "?", "?#", "?||", "?-|", "?|" and "<?>".)

I think it would be nicer to have a single mechanism that can be used consistently across multiple languages (?? doesn't work for ECPG, for example), considering that ? as a placeholder seems quite common.

Best wishes,

Bruno.



 

pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Next
From: "David G. Johnston"
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)