Browse Source

* Patch from Martin Schreiber to fix AV when using postgres 7.x

git-svn-id: trunk@10345 -
joost 17 years ago
parent
commit
0fcaf1f671
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/fcl-db/src/sqldb/postgres/pqconnection.pp

+ 2 - 1
packages/fcl-db/src/sqldb/postgres/pqconnection.pp

@@ -364,7 +364,8 @@ begin
     DatabaseError(sErrConnectionFailed + ' (PostgreSQL: ' + msg + ')',self);
     DatabaseError(sErrConnectionFailed + ' (PostgreSQL: ' + msg + ')',self);
     end;
     end;
 // This does only work for pg>=8.0, so timestamps won't work with earlier versions of pg which are compiled with integer_datetimes on
 // This does only work for pg>=8.0, so timestamps won't work with earlier versions of pg which are compiled with integer_datetimes on
-  FIntegerDatetimes := pqparameterstatus(FSQLDatabaseHandle,'integer_datetimes') = 'on';
+  if PQparameterStatus<>nil then
+    FIntegerDatetimes := pqparameterstatus(FSQLDatabaseHandle,'integer_datetimes') = 'on';
 end;
 end;
 
 
 procedure TPQConnection.DoInternalDisconnect;
 procedure TPQConnection.DoInternalDisconnect;