diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-07-13 10:01:13 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-07-13 10:01:13 +0200 |
commit | beb52e1cbd129549a4c70c44d567c891f656359f (patch) | |
tree | 4834ee1b0c25b8375fde17f40080b641275441a6 | |
parent | bcc698eacb68905bb374b9819972f549732bc13b (diff) |
Get integer_datetimes server var on connection to server
-rw-r--r-- | odb/pgsql/connection.cxx | 8 | ||||
-rw-r--r-- | odb/pgsql/connection.hxx | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/odb/pgsql/connection.cxx b/odb/pgsql/connection.cxx index 4d51817..41fa7f0 100644 --- a/odb/pgsql/connection.cxx +++ b/odb/pgsql/connection.cxx @@ -44,7 +44,15 @@ namespace odb throw database_exception (m); } + // Suppress server notifications to stdout. + // PQsetNoticeProcessor (handle_, &nop_process_notice, 0); + + // Establish whether date/time values are represented as + // 8-byte integers. + // + integer_datetimes_ = + *PQparameterStatus (handle_, "integer_datetimes") == '1'; } connection:: diff --git a/odb/pgsql/connection.hxx b/odb/pgsql/connection.hxx index 6764794..5e24749 100644 --- a/odb/pgsql/connection.hxx +++ b/odb/pgsql/connection.hxx @@ -59,14 +59,20 @@ namespace odb return *statement_cache_; } + bool + integer_datetimes () const + { + return integer_datetimes_; + } + private: connection (const connection&); connection& operator= (const connection&); private: database_type& db_; - PGconn* handle_; + bool integer_datetimes_; std::auto_ptr<statement_cache_type> statement_cache_; }; |