I recently downloaded a source package from a website which mentioned that its compatible with PostgreSQL and MySQL database.
I tried compilation on Linux Debian machine using MySQL and it works fine. However our requirements have changed now and we need to make it work with PostgreSQL.
However when i compile, seems it not compatible. Never tested with PGSQL i guess. No support from the developers also :(
Reasons:
DB_ROW db_fetch_row(DB_RES *);
Now DB_ROW is defined as follows:
#if defined(DB_MYSQL)
#include <mysql.h>
typedef MYSQL DBH;
**typedef MYSQL_ROW DB_ROW;**
typedef MYSQL_RES DB_RES;
#endif
where as its not defined for PGSQL:
#if defined(DB_PGSQL)
#include <libpq-fe.h>
#define PWLEN 13
typedef PGresult DB_RES;
typedef struct {
Gconn *conn;
DB_RES *res;
} DBH;
#endif
I tried searching for similar structure in PostgreSQL, but it seems there the implementation is different: http://www.postgresql.org/docs/9.2/static/libpq-single-row-mode.html
I could use this but doing this would make the source code specific to PGSQL.
Is there a similar structure in PGSQL?
Thanks