Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f3fcbb

Browse files
committed
Fix auto-explain JSON output to be valid JSON.
Problem reported by Peter Eisentraut.Backpatched to release 9.0.
1 parent03c66ca commit0f3fcbb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎contrib/auto_explain/auto_explain.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
248248
if (es.str->len>0&&es.str->data[es.str->len-1]=='\n')
249249
es.str->data[--es.str->len]='\0';
250250

251+
/* Fix JSON to output an object */
252+
if (auto_explain_log_format==EXPLAIN_FORMAT_JSON)
253+
{
254+
es.str->data[0]='{';
255+
es.str->data[es.str->len-1]='}';
256+
}
257+
251258
/*
252259
* Note: we rely on the existing logging of context or
253260
* debug_query_string to identify just which statement is being

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp