Skip to content

Commit 220f3f8

Browse files
committed
Fix issue discovered by Yichun.
1 parent 8d3a62f commit 220f3f8

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/ngx_postgres_output.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ ngx_postgres_output_value(ngx_http_request_t *r, PGresult *res,
5757
/* get column by name */
5858
col = PQfnumber(res, (char const *) pgv->col_name);
5959
if (col == NGX_ERROR) {
60-
if (pgv->required) {
61-
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
62-
63-
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
64-
"postgres: \"postgres_output value\" requires"
65-
" value from column \"%s\" that wasn't found"
66-
" in the received result-set in location \"%V\"",
67-
pgv->col_name, &clcf->name);
68-
}
60+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
61+
62+
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
63+
"postgres: \"postgres_output value\" requires"
64+
" value from column \"%s\" that wasn't found"
65+
" in the received result-set in location \"%V\"",
66+
pgv->col_name, &clcf->name);
6967

7068
dd("returning NGX_DONE, status NGX_HTTP_INTERNAL_SERVER_ERROR");
7169
pgctx->status = NGX_HTTP_INTERNAL_SERVER_ERROR;

0 commit comments

Comments
 (0)