Skip to content

Commit b1496fa

Browse files
committed
removed the hand-written << "in upstream \"t.shV\"", &pgdt->name >> part from most of the ngx_log_error calls in ngx_postgres_keepalive.c because they are duplicate with the << upstream: "postgres://ip.add.re.ss:port" >> part automatically generated by the ngx_http_log_error_handler function in the nginx core.
1 parent c62c673 commit b1496fa

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/ngx_postgres_processor.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ ngx_postgres_upstream_connect(ngx_http_request_t *r, ngx_connection_t *pgxc,
184184
if (pgrc != PGRES_POLLING_OK) {
185185
dd("connection failed");
186186
ngx_log_error(NGX_LOG_ERR, pgxc->log, 0,
187-
"postgres: connection failed: %s in upstream \"%V\"",
188-
PQerrorMessage(pgdt->pgconn), &pgdt->name);
187+
"postgres: connection failed: %s",
188+
PQerrorMessage(pgdt->pgconn));
189189

190190
dd("returning NGX_ERROR");
191191
return NGX_ERROR;
@@ -232,8 +232,8 @@ ngx_postgres_upstream_send_query(ngx_http_request_t *r, ngx_connection_t *pgxc,
232232
if (pgrc == 0) {
233233
dd("sending query failed");
234234
ngx_log_error(NGX_LOG_ERR, pgxc->log, 0,
235-
"postgres: sending query failed: %s in upstream \"%V\"",
236-
PQerrorMessage(pgdt->pgconn), &pgdt->name);
235+
"postgres: sending query failed: %s",
236+
PQerrorMessage(pgdt->pgconn));
237237

238238
dd("returning NGX_ERROR");
239239
return NGX_ERROR;
@@ -282,8 +282,8 @@ ngx_postgres_upstream_get_result(ngx_http_request_t *r, ngx_connection_t *pgxc,
282282
if (res == NULL) {
283283
dd("receiving result failed");
284284
ngx_log_error(NGX_LOG_ERR, pgxc->log, 0,
285-
"postgres: receiving result failed: %s in upstream"
286-
" \"%V\"", PQerrorMessage(pgdt->pgconn), &pgdt->name);
285+
"postgres: receiving result failed: %s",
286+
PQerrorMessage(pgdt->pgconn));
287287

288288
dd("returning NGX_ERROR");
289289
return NGX_ERROR;
@@ -293,9 +293,9 @@ ngx_postgres_upstream_get_result(ngx_http_request_t *r, ngx_connection_t *pgxc,
293293
if ((pgrc != PGRES_COMMAND_OK) && (pgrc != PGRES_TUPLES_OK)) {
294294
dd("receiving result failed");
295295
ngx_log_error(NGX_LOG_ERR, pgxc->log, 0,
296-
"postgres: receiving result failed: %s: %s in upstream"
297-
" \"%V\"", PQresStatus(pgrc),
298-
PQerrorMessage(pgdt->pgconn), &pgdt->name);
296+
"postgres: receiving result failed: %s: %s",
297+
PQresStatus(pgrc),
298+
PQerrorMessage(pgdt->pgconn));
299299

300300
PQclear(res);
301301

@@ -428,8 +428,7 @@ ngx_postgres_upstream_get_ack(ngx_http_request_t *r, ngx_connection_t *pgxc,
428428
if (res != NULL) {
429429
dd("receiving ACK failed");
430430
ngx_log_error(NGX_LOG_ERR, pgxc->log, 0,
431-
"postgres: receiving ACK failed: multiple queries(?),"
432-
" in upstream \"%V\"", &pgdt->name);
431+
"postgres: receiving ACK failed: multiple queries(?)");
433432

434433
PQclear(res);
435434

0 commit comments

Comments
 (0)