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

Postgres Interval type #51

Open keshov opened 8 years ago

keshov commented 8 years ago

I'm using this module in couple with ngx_rds_json. One of my table contains field with type 'interval'. When I want to build json page with simple select result of this table, I receive a broken json content.

It's because I have something like that inside a response: ... ,"postpone":00:00:02, ...

You treat postgres interval type as float for RDS. src/resty_dbd_stream.h: rds_col_type_interval = 10 | rds_rough_col_type_float,

I am not familiar with RDS at all. May be in its conception it's all right, but not sure... May be change rds_rough_col_type_float with rds_rough_col_type_str? For me it solved the problem but I'm not sure that this is correct.

agentzh commented 8 years ago

@keshov I'm not sure about that. You're encouraged to do the investigation and experiment on your side :) Thanks!