Skip to content

Postgres JSON type doesn't like buffer values #600

@twolfson

Description

@twolfson

I am trying to get orm setup on an existing database that leverages JSON columns. It looks like the object type is saving to hexadecimal values. However, Postgres 9.3 doesn't like this. Can we remove this buffer escaping (prob not since we have #378) or add a new type called json which doesn't encode into hex (a la #381)?

$ createdb buffer-test
$ psql buffer-test 
psql (9.3.5)
Type "help" for help.

buffer-test=# CREATE TABLE items (item json);
CREATE TABLE
buffer-test=# INSERT INTO items (item) VALUES ('{}');
INSERT 0 1
buffer-test=# INSERT INTO items (item) VALUES ('\x7b7d');
ERROR:  invalid input syntax for type json
LINE 1: INSERT INTO items (item) VALUES ('\x7b7d');
                                         ^
DETAIL:  Token "\" is invalid.
CONTEXT:  JSON data, line 1: \...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions