Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Postico doesn't properly display Unicode sequences with U+000000 #523
You can use this template for reporting bugs.
What did you do?
When viewing data with the NULL bye, U+000000, Postico will truncate display of that data instead of properly interpreting the character sequence.
Here is the data in Postico:
Here is the data in Python:
Notice the Python data is significantly longer. Here is a JSON file with the sample data.
If you happen to have access to Redshift, you can reproduce this easily. Here is a link to a Gist covering the exact issue with relation to Redshift, and also steps to reproduce.
What did you expect to happen?
I expected to see the full unicode string displayed, instead of only up to the first NULL byte.
What actually happened?
I only see a partial string, which stops at the first NULL byte.
What software versions are you using?
Postico version: 1.3.3
macOS version: 10.12.6
PostgreSQL version: PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.1980
I've done some investigation, and I'm pretty it's a bug in Redshifts data loading. VARCHARs shouldn't contain zero bytes.
I've tried to insert a string with a 0 byte into a VARCHAR column. PostgreSQL absolutely refuses to do that (raises an error:
I also tried inserting 0 bytes into Redshift. I couldn't find a way to do that either with normal INSERT statements. Redshift just truncated the string at the zero byte.
But somehow you did manage to insert a zero byte, and it seemed like an easy fix to make Postico accept zero bytes, so I did that. Postico build bot should post a link as soon as CI is done testing.
I had no way to test if the fix actually works, so I'd appreciate your feedback.
Awesome, thanks for digging in. To reproduce on Redshift I had to use the COPY command on JSON. Writing the following to a JSON file worked for me:
As far as I can tell Redshift is doing some weird stuff with the COPY/UNLOAD commands that gets around the normal Postgres ingestion routine, hence the ability to ingest