From f0a9bb6913e95913236c39a198bb28b8094c97af Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 30 Oct 2015 09:28:30 +0100 Subject: [PATCH] Fix pgsql backend compilation on centos 6 --- modules/gpgsqlbackend/spgsql.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index 44e08da1d..f8954e5f6 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -96,10 +96,16 @@ public: // by stored procedures. you can return more than one // if you return SETOF refcursor. if (PQftype(d_res_set, 0) == 1790) { // REFCURSOR +#if PG_VERSION_NUM > 90000 + // PQescapeIdentifier was added to libpq in postggresql 9.0 char *val = PQgetvalue(d_res_set, d_cur_set++, 0); char *portal = PQescapeIdentifier(d_db(), val, strlen(val)); string cmd = string("FETCH ALL FROM \"") + string(portal) + string("\""); PQfreemem(portal); +#else + string portal = string(PQgetvalue(d_res_set, d_cur_set++, 0)); + string cmd = string("FETCH ALL FROM \"") + portal + string("\""); +#endif // execute FETCH if (d_dolog) L<