pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: James Cloos <cloos@jhcloos.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: pg should ignore u+200b zero width space
Date: Tue, 3 Nov 2020 15:52:45 +0200
Message-ID: <e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi> (raw)
In-Reply-To: <m3k0v21rss.fsf@carbon.jhcloos.org>
References: <m3k0v21rss.fsf@carbon.jhcloos.org>

On 03/11/2020 15:41, James Cloos wrote:
> i had a hell of a night last night trying to figure out what was wrong
> with an attempt to use on constraint.
> 
> this morning i tried again and it worked.
> 
> but pasting the failed line from .psql_history into psql still failed.
> 
> i had to resort to od(1) to discover a no break space showed up just
> before on constraint in the failing lines.
> 
> pg should treat a no break space after whitespace as just more
> whitespace.
> 
> i'm not sure about alone between printing characters, but definitely
> immediately after current whitespace characters.

Hmm. I'm not sure if change the behavior is a good idea, but a hint in 
the error message would be nice. Something like:

postgres=# insert ​into foo values (1);
ERROR:  syntax error at or near "​into"
LINE 1: insert ​into foo values (1);
                ^
HINT: There is a zero-width space character (U+200B) on the line.

Patches are welcome. Are there other problematic characters like that?

- Heikki





view thread (6+ messages)  latest in thread

Message-ID: <e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi>
Permalink:  ../e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi/
Also on:    postgresql.org/message-id/e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnaka@iki.fi, cloos@jhcloos.com
  Subject: Re: pg should ignore u+200b zero width space
  In-Reply-To: <e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi>
  References: <m3k0v21rss.fsf@carbon.jhcloos.org> <e1c98248-ac7b-5fd2-0b74-86669054d58a@iki.fi>

* 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