Starting with the easiest native API, here is the PostgreSQL version of that get_name patch.

--
Bojan
diff -rauN apr-util-vanilla/dbd/apr_dbd_pgsql.c apr-util/dbd/apr_dbd_pgsql.c
--- apr-util-vanilla/dbd/apr_dbd_pgsql.c	2005-11-29 10:31:28.000000000 +1100
+++ apr-util/dbd/apr_dbd_pgsql.c	2006-02-14 15:41:27.000000000 +1100
@@ -116,6 +116,15 @@
     return 0;
 }
 
+static const char *dbd_pgsql_get_name(const apr_dbd_results_t *res, int n)
+{
+    if ((n < 0) || (n >= res->sz)) {
+        return NULL;
+    }
+
+    return PQfname(res->res, n);
+}
+
 static int dbd_pgsql_get_row(apr_pool_t *pool, apr_dbd_results_t *res,
                              apr_dbd_row_t **rowp, int rownum)
 {
@@ -640,5 +649,6 @@
     dbd_pgsql_pvselect,
     dbd_pgsql_pquery,
     dbd_pgsql_pselect,
+    dbd_pgsql_get_name
 };
 #endif

Reply via email to