From e23bee40459fb90f297ce5f95d87574cd7caf6d0 Mon Sep 17 00:00:00 2001 From: randomdan Date: Tue, 11 Mar 2014 20:50:32 +0000 Subject: Add handler for PostgreSQL dates (with no times) --- libpqpp/column.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libpqpp') diff --git a/libpqpp/column.cpp b/libpqpp/column.cpp index 1f7b932..745fdd5 100644 --- a/libpqpp/column.cpp +++ b/libpqpp/column.cpp @@ -61,8 +61,11 @@ PQ::Column::apply(DB::HandleField & h) const } break; } - case 702: //ABSTIMEOID: case 1082: //DATEOID: + h.timestamp(boost::posix_time::ptime( + boost::gregorian::from_string(PQgetvalue(sc->execRes, sc->tuple, colNo)))); + break; + case 702: //ABSTIMEOID: case 1114: //TIMESTAMPOID: case 1184: //TIMESTAMPTZOID: h.timestamp(boost::posix_time::time_from_string(PQgetvalue(sc->execRes, sc->tuple, colNo))); -- cgit v1.2.3