diff options
| author | randomdan <randomdan@localhost> | 2014-03-11 20:50:32 +0000 | 
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2014-03-11 20:50:32 +0000 | 
| commit | e23bee40459fb90f297ce5f95d87574cd7caf6d0 (patch) | |
| tree | b445574b8b943d608d30ec02fced2aefac7d040d | |
| parent | Adds native support for time_duration as a variable type (diff) | |
| download | libdbpp-postgresql-e23bee40459fb90f297ce5f95d87574cd7caf6d0.tar.bz2 libdbpp-postgresql-e23bee40459fb90f297ce5f95d87574cd7caf6d0.tar.xz libdbpp-postgresql-e23bee40459fb90f297ce5f95d87574cd7caf6d0.zip  | |
Add handler for PostgreSQL dates (with no times)
| -rw-r--r-- | libpqpp/column.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
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)));  | 
