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
Null character "\u0000" in transaction type 0 data field throws error #2370
Special character (Null Character “\u0000”) cannot be converted from database type “bytea” to “text”, which causes the database to throw an error. Null character “\u0000” is a valid UTF8 character in Node.js, but Postgres is not able to convert the null character from the bytea to Text. In our case, transaction type 0 data field was saved in “bytea”, which accepts the null character. However, when we get the transaction information from the database, it is converted from “bytea” to “text” format in database layer.
It should not fail when reading from the database.
The current code converts the bytea code to utf-8 and PostgreSQL can't convert null octet to utf8, the following part of the code causes the error
Steps to reproduce
Which version(s) does this affect? (Environment, OS, etc...)