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

Compilation error on nginx > 1.10 #57

Open c0de9en opened 7 years ago

c0de9en commented 7 years ago

make[1]: Entering directory '/usr/local/src/nginx-1.13.2' cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/postgresql -I objs -I src/http -I src/http/modules -I ../njs/nginx/../nxt -I ../njs/nginx/../njs -I src/stream -I ../njs/nginx/../nxt -I ../njs/nginx/../njs \ -o objs/addon/src/ngx_postgres_module.o \ ../ngx_postgres/src/ngx_postgres_module.c ../ngx_postgres/src/ngx_postgres_module.c: In function ‘ngx_postgres_find_upstream’: ../ngx_postgres/src/ngx_postgres_module.c:1323:21: error: ‘ngx_http_upstream_srv_conf_t {aka struct ngx_http_upstream_srv_conf_s}’ has no member named ‘default_port’ if (uscfp[i]->default_port && url->default_port ^ ../ngx_postgres/src/ngx_postgres_module.c:1324:25: error: ‘ngx_http_upstream_srv_conf_t {aka struct ngx_http_upstream_srv_conf_s}’ has no member named ‘default_port’ && (uscfp[i]->default_port != url->default_port)) ^ objs/Makefile:1454: recipe for target 'objs/addon/src/ngx_postgres_module.o' failed

agentzh commented 7 years ago

@an0ma1ia See the patch in #52.

c0de9en commented 7 years ago

Thank you. I commented out that IF and compiled nginx. Is it possible to apply the patch to the official sources?

agentzh commented 7 years ago

@an0ma1ia Yes, when this module is officially tested against newer versions of nginx. Before that, you are at your own risk if you haven't run the test suite in all those test modes yourself :)

See https://qa.openresty.org/

pbkh-kimheang commented 4 years ago

I have the same problem. I am new to NGINX. Could you help please?