Re: Problems with question marks in operators (JDBC, ECPG, ...)

Поиск
Список
Период
Сортировка
От Bruno Harbulot
Тема Re: Problems with question marks in operators (JDBC, ECPG, ...)
Дата
Msg-id CANPVNBaU6ik_EYMxEWL_yJ7TYZiVVs46kO6H+2qdzBs_ZBcmZA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Robert Haas <robertmhaas@gmail.com>)
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Problems with question marks in operators (JDBC, ECPG, ...)