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

From Jeff Janes
Subject Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date
Msg-id CAMkU=1yaN3jtUifuhu=PkR7JN52hOpcwF0BsdJhqHF-2+XyXBA@mail.gmail.com
Whole thread Raw
In response to Re: Problems with question marks in operators (JDBC, ECPG, ...)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, May 20, 2015 at 11:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jeff Janes <jeff.janes@gmail.com> writes:
> What if something like this was made to work?
>  select '{"3":5}'::jsonb operator("pg_catalog"."?") '3';
> (Where the double quotes around the ? would be tolerated, which they
> currently are not)

> Is there a reason it can't be made to work?

It could be made to work, I'm sure, but I fail to see why any user
would prefer to write that over ?? or \? or {?} or pretty much any
of the other notations that've been suggested.  It's ten times as
many keystrokes ...

Because it is a completely general solution using the existing escaping infrastructure, on both ends, except for this one small exception.

It is ugly, but so is leaning toothpick syndrome where you have to escape your escapes from someone else's escapes.

Anyway, I've never looked at code written to use JDBC and thought "Boy, that sure is pretty".

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Next
From: Andrew Dunstan
Date:
Subject: Re: jsonb concatenate operator's semantics seem questionable