diff -c psqlodbc.orig/connection.c psqlodbc/connection.c *** psqlodbc.orig/connection.c 2005-12-02 14:24:39.000000000 +0100 --- psqlodbc/connection.c 2005-12-04 00:36:26.636520704 +0100 *************** *** 1626,1631 **** --- 1626,1637 ---- int CC_send_cancel_request(const ConnectionClass *conn) { + #if defined PGSQL_VERSION && PGSQL_VERSION < 80 + if (PQrequestCancel(conn->pgconn)) + return TRUE; + else + return FALSE; + #else int ret = 0,errbufsize=256; char errbuf[256]; PGcancel *cancel; *************** *** 1645,1651 **** PQfreeCancel(cancel); return FALSE; } ! return ret; } --- 1651,1657 ---- PQfreeCancel(cancel); return FALSE; } ! #endif /* PGSQL_VERSION < 80 */ } *************** *** 1867,1873 **** --- 1873,1883 ---- mylog("the server returned the error: %s\n", errbuffer); CC_set_error(self, CONNECTION_SERVER_REPORTED_ERROR, errbuffer); + #if defined PGSQL_VERSION && PGSQL_VERSION < 74 + CC_set_sqlstate(self, "HY000"); + #else CC_set_sqlstate(self, PQresultErrorField(pgres, PG_DIAG_SQLSTATE)); + #endif /* PGSQL_VERSION < 7.4 */ PQclear(pgres); return qres;