Re: jsonb problematic operators

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Geoff Winkless <gwinkless(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb problematic operators
Date: 2016-12-12 04:59:32
Message-ID: CAMsr+YH5XkKpAndb9jMLtz4EuctR4H7UmqeN5EQsE1-R8oVpdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12 December 2016 at 12:52, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Craig Ringer <craig(at)2ndquadrant(dot)com> writes:
>> It's definitely annoying, in both directions. ? wasn't a great choice
>> for an operator character but it's logical and was grandfathered over
>> from hstore.
>
> It was grandfathered from a lot further back than that. A quick look
> into the system catalogs says that core Postgres currently has 21
> operators that include "?" in their names. Three of those are the
> jsonb operators, and the other 18 have been there since circa 1997.
> (Most of them seem to date to Tom Lockhart's commit 3c2d74d2a, but
> "<?>" is present in Berkeley Postgres v4r2, released in 1994.)
>
> I do not have a lot of patience with client-side code that's unable
> to deal with operator names containing "?". It's not like this
> requirement has blindsided anybody in this century.

Pretty much. Nor is it the only oddity you have to deal with when
working with different DBMSes.

PgJDBC allows you to write ??, which is ugly, but tolerable, since the
JDBC spec doesn't have an escape syntax for it. We could've extended
the JDBC escape syntax with a new kind of {postgres } escape if we'd
wanted instead, but it'd still be nonportable so the driver went for
the less verbose option. PDO should do something similar. It's not
like client code using our ? operators has to be portable.

I didn't realise Pg's use of ? was that old, so thanks. That makes
offering alternatives much less appealing.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-12-12 05:06:45 Re: [COMMITTERS] pgsql: Implement table partitioning.
Previous Message Amit Kapila 2016-12-12 04:58:07 Re: Hash Indexes