m6w6 / ext-pq

PostgreSQL client library (libpq) binding
BSD 2-Clause "Simplified" License
39 stars 7 forks source link

Failed test with Postgresql < 9.3 #19

Closed remicollet closed 5 years ago

remicollet commented 8 years ago

Only because of missing entries in "diag"

Version 1.1.1 and 2.1.1:

async exec [tests/async003.phpt]
async exec params [tests/async004.phpt]
async prepared statement [tests/async005.phpt]
async unbuffered exec [tests/async006.phpt]
cancel [tests/cancel001.phpt]
ParkFramework commented 8 years ago

Maybe it will be easier to give up the old versions, make the version requirement PostgreSQL >= 9.3 (or 9.4)

remicollet commented 8 years ago

@ParkFramework 9.2 is the version available in RHEL / CentOS 7 (a quite common distro)

DaveRandom commented 8 years ago

@m6w6 how would you feel about ensuring the array format is always the same by putting dummy NULLs in for fields that an older pq doesn't provide? Feels like a cleaner solution to me than branching/skipping tests on pq version, esp. as this is basically what userland would end up having to do as well.

m6w6 commented 8 years ago

Sounds like a good plan, actually!

remicollet commented 8 years ago

@m6w6 using, for each constant

#ifndef PG_DIAG_SCHEMA_NAME
#define PG_DIAG_SCHEMA_NAME 's'
#endif

From a quick check into the sources, the call to PQresultErrorField will return NULL for unkown case. Could be a simple way.