Answer the question
In order to leave comments, you need to log in
Carriage return \r\n\ JSON?
I make a request like this
WITH T AS
(SELECT userid, dbid, queryid, query, calls, round(total_time) as total_time, rows as total_rows, round(total_time/calls) as average_time
FROM pg_stat_statements
ORDER BY average_time
DESC LIMIT 5)
SELECT json_object_agg(userid, row_to_json(T))
FROM T
[{"userid":"16384","dbid":"1848551","queryid":1057054500,"query":"SELECT DISTINCT doc.*,\r\n\t\t substring(doc.\"MEDO_DETAIL\" FROM 'POSTALADDRESS=(.*?)\\|') as \"MEDO_ADDRESS\", \r\n\t\t medo_country.name as \"MEDO_COUNTRY\", \r\n\t\t doc_movement.\"PPID\" as \"DOCMOVEMENT_PPID\",\r\n\t\t country.name AS \"COUNTRY\" ,\r\n\t\t citizen.firstname AS
etc. Answer the question
In order to leave comments, you need to log in
JSON strings do not support line breaks within themselves, so CRLF is replaced with \r\n. if you make a conditional console.log(result[0].query), then it will be displayed as it should
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question