Re: [HACKERS] jsonb problematic operators - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] jsonb problematic operators
Date
Msg-id CAMsr+YH5XkKpAndb9jMLtz4EuctR4H7UmqeN5EQsE1-R8oVpdg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] jsonb problematic operators  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] jsonb problematic operators
Re: [HACKERS] jsonb problematic operators
List pgsql-hackers
On 12 December 2016 at 12:52, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Craig Ringer <craig@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Hash Indexes
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.