summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-07-10 08:27:00 +0200
committerPeter Eisentraut <peter@eisentraut.org>2020-07-10 08:32:06 +0200
commitff61359ad7cd10e48a9ce662b5f2a5e7f3ca23e1 (patch)
tree0e7ac171f3240ce21a860e54b10331d4c97dea90
parent986529ce40c6edcd7f83689c00fcfaab8d9436d8 (diff)
Log the location field before any backtrace
This order makes more sense because the location is effectively at the lowest level of the backtrace. Discussion: https://www.postgresql.org/message-id/flat/90f5fa04-c410-a54e-9449-aa3749fb7972%402ndquadrant.com
-rw-r--r--src/backend/utils/error/elog.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index e9762010309..e4b717c79a9 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -2938,13 +2938,6 @@ send_message_to_server_log(ErrorData *edata)
append_with_tabs(&buf, edata->context);
appendStringInfoChar(&buf, '\n');
}
- if (edata->backtrace)
- {
- log_line_prefix(&buf, edata);
- appendStringInfoString(&buf, _("BACKTRACE: "));
- append_with_tabs(&buf, edata->backtrace);
- appendStringInfoChar(&buf, '\n');
- }
if (Log_error_verbosity >= PGERROR_VERBOSE)
{
/* assume no newlines in funcname or filename... */
@@ -2962,6 +2955,13 @@ send_message_to_server_log(ErrorData *edata)
edata->filename, edata->lineno);
}
}
+ if (edata->backtrace)
+ {
+ log_line_prefix(&buf, edata);
+ appendStringInfoString(&buf, _("BACKTRACE: "));
+ append_with_tabs(&buf, edata->backtrace);
+ appendStringInfoChar(&buf, '\n');
+ }
}
/*