On Fri, 31 May 2019 at 12:27, Matteo Beccati <p...@beccati.com> wrote:

> Hi everyone,
>
> following some recent unrest in the comments of the related PR, I've
> decided to invest a bit of time on it and finally move it to draft status:
>
> https://wiki.php.net/rfc/pdo_escape_placeholders
>


Hi Matteo,

This sounds like a very useful change. As you say in the RFC, these
operators are going to be more and more common for Postgres users now that
they've been defined for JSON types, and users of most other DBMSes will be
completely unaffected.

I wonder if there's any way we can gauge the BC impact, specifically this
case:

> The only exception to that is that Postgres (and possibly other RDMSs)
allows the creation of custom operators: anyone having a custom “??”
operator in use would need to escape it as “????”.

- Are there any standard or public Postgres extensions that define a "??"
operator? e.g. anything published on https://pgxn.org/
- Are there any other databases supported by PDO that allow custom
operators, or which might have a "??" operator or syntax token?

If there is a risk of this affecting a reasonable number of people, we
could add a deprecation notice on encountering "??" in any SQL string in
7.4, and postpone adding the escaping mechanism until 8.0.


One other thing worth clarifying is the precise circumstances where ?? will
be treated as an escape. Is it only when it's a separate "word" (start/end
of string or surrounded by whitespace)? For instance, would "A ??= B" be
"unescaped" to "A ?= B" or passed through as is? Note that this changes the
scope of the BC break, as well as the usability of the chosen syntax, as
both "?=" and "??=" could be defined as operators.


Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to