Re: jsonb problematic operators

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jordan Gigov <coladict(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb problematic operators
Date: 2016-12-09 17:17:32
Message-ID: CA+TgmoZe+9Z7Of_NsfB8k7w3WG+yCAxM=fNeKuTPvUfXO+n=BQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 9, 2016 at 6:50 AM, Jordan Gigov <coladict(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2016-12-09 17:38:09 Re: jsonb problematic operators
Previous Message Alvaro Herrera 2016-12-09 16:26:17 Re: pg_dump / copy bugs with "big lines" ?