From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: James Cloos <cloos@jhcloos.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: pg should ignore u+200b zero width space
Date: Tue, 03 Nov 2020 11:19:04 -0500
Message-ID: <922842.1604420344@sss.pgh.pa.us> (raw)
In-Reply-To: <c6037756-6446-79be-8c3d-cb7d55c30cb0@iki.fi>
References: <m3k0v21rss.fsf@carbon.jhcloos.org>
<e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi>
<919181.1604415167@sss.pgh.pa.us>
<c6037756-6446-79be-8c3d-cb7d55c30cb0@iki.fi>
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 03/11/2020 16:52, Tom Lane wrote:
>> Perhaps it'd be all right to confine the change in behavior to
>> just modifying the error text in cases where we were going to
>> throw an error anyway. But I think this is much harder than
>> it sounds to do in a valid, safe way.
> Yeah, my thinking was to just add a hint when you're throwing a syntax
> error anyway. Something simple like check if client_encoding is utf8 and
> there is a U+200b in the query string, and add the hint if so. It
> doesn't need to catch all cases, and rare false positives are OK too.
TBH, that's exactly the kind of under-baked solution I *don't* want.
For starters, &zwsp is hardly the only problem here; even more common
is  , which exists in most encodings not only UTF8. And once we
had that, there'd no doubt be pressure to ignore BOMs. And so on.
Also I don't really want us throwing such errors when the funny space is
inside a literal or comment; chasing false positives like that will cost
users way more time than they could save when the hint is on-point.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi, cloos@jhcloos.com, pgsql-bugs@lists.postgresql.org
Subject: Re: pg should ignore u+200b zero width space
In-Reply-To: <922842.1604420344@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox