hasura / hasura/graphql-engine

PostgreSQL hdb_catalog.insert_event log fails when raw_data contains Unicode sequence \u0000

Open
#6,782 0 comments 0 reactions 0 assignees View on GitHub
a/eventing p/medium
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I'm using Hasura v1.3.3 and PostgreSQL 11.10.
I've configured event trigger for updates on a table that has a column type json. If any row of the table have an \u0000 unicode sequence in that column then any update over that row fail because the hdb_catalog.insert_event_log function fails with error :

`
ERROR: unsupported Unicode escape sequence
Detail: \u0000 cannot be converted to text.
Where: JSON ...
SQL statement "INSERT INTO hdb_catalog.event_log
(id, schema_name, table_name, trigger_name, payload)
VALUES
(id, schema_name, table_name, trigger_name, payload)"
PL/pgSQL function hdb_catalog.insert_event_log(text,text,text,text,json) line 32 at SQL statement`
[](url)
I currently fixed it modifying the SQL function, removing \u0000 in row_data argument of hdb_catalog.insert_event log.

Is there any plan on a solution for this? Or maybe allowing the update statement to work even when the trigger fails?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.