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

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bruno Harbulot <bruno(at)distributedmatter(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-20 18:29:16
Message-ID: CAMkU=1yaN3jtUifuhu=PkR7JN52hOpcwF0BsdJhqHF-2+XyXBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 20, 2015 at 11:13 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Jeff Janes <jeff(dot)janes(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2015-05-20 18:34:17 Re: jsonb concatenate operator's semantics seem questionable
Previous Message Andres Freund 2015-05-20 18:26:17 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0