FRiCKLE / ngx_postgres

upstream module that allows nginx to communicate directly with PostgreSQL database.
http://labs.frickle.com/nginx_ngx_postgres/
BSD 2-Clause "Simplified" License
545 stars 122 forks source link

using postgres_output value will result in error 500 instead of 404 when not getting rows #55

Open rauberdaniel opened 7 years ago

rauberdaniel commented 7 years ago

I tried to combine postgres_output value with postgres_rewrite no_rows =404 to achieve returning the single value that is returned by postgres or a 404 error when nothing is returned. However, this results in a server error 500 because postgres_output value expects exactly 1 value but received 0.