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

From Robert Haas
Subject Re: [HACKERS] jsonb problematic operators
Date
Msg-id CA+TgmoZe+9Z7Of_NsfB8k7w3WG+yCAxM=fNeKuTPvUfXO+n=BQ@mail.gmail.com
Whole thread Raw
In response to [HACKERS] jsonb problematic operators  (Jordan Gigov <coladict@gmail.com>)
Responses Re: [HACKERS] jsonb problematic operators
Re: [HACKERS] jsonb problematic operators
List pgsql-hackers
On Fri, Dec 9, 2016 at 6:50 AM, Jordan Gigov <coladict@gmail.com> wrote:
> It's not a good idea to expect everyone else to make for workarounds
> for problems you choose to create.

True.  I actually kinda agree that the use of ? wasn't a great choice
here, precisely because a number of drivers do use it to indicate a
placeholder.  However, I also think that it was done without realizing
that it was going to create problems.  Your phrasing implies that we
did that on purpose just to mess with users, which isn't true.

As Geoff says, you don't have to use the operators; you could use the
equivalent functions instead.  Every operator just gets turned into a
function call internally, so this is always possible.

It would also be smart for driver authors who use ? to indicate a
placeholder to also provide some way of escaping it.  There are plenty
of perfectly valid PostgreSQL queries that include a ? as something
other than a driver-interpreted placeholder, and if driver authors
have failed to foresee that, it's not entirely our fault.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] pg_dump / copy bugs with "big lines" ?
Next
From: Merlin Moncure
Date:
Subject: Re: [HACKERS] jsonb problematic operators