Skip to content

Nullbytes can still be an issue in SQL output to JSONB #2652

@kamil-certat

Description

@kamil-certat

The PostgreSQL JSOB column explicitly disallow saving nullbytes like \u0000: https://www.postgresql.org/docs/current/datatype-json.html
This has been previously addressed in #2203

Yet, the fix based on simply replace causes another issue: if the data contains already escaped \\u0000, it will be rewritten to \\\u0000, effectively unescaping the data.

At the moment, the simplest working solution I see is removing the nullbyte at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcomponent: bots

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions