aboutsummaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
Diffstat (limited to 'odb')
-rw-r--r--odb/pgsql/connection.cxx8
-rw-r--r--odb/pgsql/connection.hxx7
2 files changed, 5 insertions, 10 deletions
diff --git a/odb/pgsql/connection.cxx b/odb/pgsql/connection.cxx
index fb1ea26..b4790b0 100644
--- a/odb/pgsql/connection.cxx
+++ b/odb/pgsql/connection.cxx
@@ -3,7 +3,8 @@
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
-#include <new> // std::bad_alloc
+#include <new> // std::bad_alloc
+#include <cstring> // std::strcmp
#include <string>
#include <odb/pgsql/database.hxx>
@@ -48,8 +49,9 @@ namespace odb
// Establish whether date/time values are represented as
// 8-byte integers.
//
- integer_datetimes_ =
- *PQparameterStatus (handle_, "integer_datetimes") == '1';
+ if (strcmp (PQparameterStatus (handle_, "integer_datetimes"), "on") != 0)
+ throw database_exception ("unsupported binary format for PostgreSQL "
+ "date-time SQL types");
}
connection::
diff --git a/odb/pgsql/connection.hxx b/odb/pgsql/connection.hxx
index 5e24749..4793248 100644
--- a/odb/pgsql/connection.hxx
+++ b/odb/pgsql/connection.hxx
@@ -59,12 +59,6 @@ namespace odb
return *statement_cache_;
}
- bool
- integer_datetimes () const
- {
- return integer_datetimes_;
- }
-
private:
connection (const connection&);
connection& operator= (const connection&);
@@ -72,7 +66,6 @@ namespace odb
private:
database_type& db_;
PGconn* handle_;
- bool integer_datetimes_;
std::auto_ptr<statement_cache_type> statement_cache_;
};