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

From: Bruno Harbulot <bruno(at)distributedmatter(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-15 20:58:03
Message-ID: CANPVNBaU6ik_EYMxEWL_yJ7TYZiVVs46kO6H+2qdzBs_ZBcmZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 15, 2015 at 9:41 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Fri, May 15, 2015 at 4:38 PM, Dave Cramer <pg(at)fastcrypt(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-05-15 21:04:26 Re: Problems with question marks in operators (JDBC, ECPG, ...)
Previous Message Dave Cramer 2015-05-15 20:45:52 Re: Problems with question marks in operators (JDBC, ECPG, ...)