The following bug has been logged on the website:
Bug reference: 13160
Logged by: Andy
Email address: me(at)andrewray(dot)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\""}