Hi this is a simultaneously a prisma question and ...
# prisma-client
b
Hi this is a simultaneously a prisma question and a postgres question I have a JSON field, and I sent it something simple like '{"a":1}' When I do this I get the following error:
Copy code
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("22021"), message: "invalid byte sequence for encoding \"UTF8\": 0x00", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("wchar.c"), line: Some(2017), routine: Some("report_invalid_encoding") }) }) })
I tried to replicate this in "raw" postgres:
Copy code
insert into test (foo) values ('{"a":1}')
and it fails with
invalid input syntax for type json
however
Copy code
insert into test (foo) values ('{"a": 1}')
adding a space
Copy code
insert into test (foo) values ('{"a":"1"}')
or sending a string works fine