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