BUG #13160: Incorrect escaping of quotes in JSON export

Поиск
Список
Период
Сортировка
От me@andrewray.me
Тема BUG #13160: Incorrect escaping of quotes in JSON export
Дата
Msg-id 20150425195313.2561.68542@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #13160: Incorrect escaping of quotes in JSON export  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13160
Logged by:          Andy
Email address:      me@andrewray.me
PostgreSQL version: 9.3.5
Operating system:   OSX
Description:

Postgres escapes quotes incorrectly when creating a JSON export.

    UPDATE models SET column='"hello"' WHERE id=1;

    COPY (SELECT row_to_json(models)
        FROM (SELECT column FROM shaders WHERE id=1) shaders)
        TO '/output.json';

The contents of output.json:

    {"column":"\\"hello\\""}

You can see that the quotes are escaped improperly and it creates invalid
JSON.
It should be:

    {"column":"\"hello\""}

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Patrice Drolet
Дата:
Сообщение: Re: BUG #13143: Cannot stop and restart a streaming server with a replication slot
Следующее
От: cees.van.zeeland@xs4all.nl
Дата:
Сообщение: BUG #13168: DROP DATABASE does not clean up all references