diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-10-08 14:26:11 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-10-08 14:37:42 +0100 |
commit | 8a9378134b8cc3f48c07ba47e692934401c51715 (patch) | |
tree | 8e96e98bb39d7e075e8214fc2e0b3b98f5fd3cfc /libpqpp/pq-binarycolumn.cpp | |
parent | Don't use &vector.front() for vector which might be empty (diff) | |
download | libdbpp-postgresql-8a9378134b8cc3f48c07ba47e692934401c51715.tar.bz2 libdbpp-postgresql-8a9378134b8cc3f48c07ba47e692934401c51715.tar.xz libdbpp-postgresql-8a9378134b8cc3f48c07ba47e692934401c51715.zip |
Use proper defines for column types
Diffstat (limited to 'libpqpp/pq-binarycolumn.cpp')
-rw-r--r-- | libpqpp/pq-binarycolumn.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libpqpp/pq-binarycolumn.cpp b/libpqpp/pq-binarycolumn.cpp index 0a488f7..514a145 100644 --- a/libpqpp/pq-binarycolumn.cpp +++ b/libpqpp/pq-binarycolumn.cpp @@ -5,6 +5,7 @@ #include <cstdint> #include <endian.h> #include <error.h> +#include <server/catalog/pg_type_d.h> PQ::BinaryColumn::BinaryColumn(const PQ::SelectBase * s, unsigned int f) : PQ::Column(s, f) { } @@ -16,25 +17,25 @@ PQ::BinaryColumn::apply(DB::HandleField & h) const return; } switch (oid) { - case 18: // CHAROID: - case 1043: // VARCHAROID: - case 25: // TEXTOID: - case 142: // XMLOID: + case CHAROID: + case VARCHAROID: + case TEXTOID: + case XMLOID: h.string({value(), length()}); break; - case 16: // BOOLOID: + case BOOLOID: h.boolean(valueAs<bool>()); break; - case 21: // INT2OID: + case INT2OID: h.integer(static_cast<int64_t>(be16toh(valueAs<uint16_t>()))); break; - case 23: // INT4OID: + case INT4OID: h.integer(static_cast<int64_t>(be32toh(valueAs<uint32_t>()))); break; - case 20: // INT8OID: + case INT8OID: h.integer(static_cast<int64_t>(be64toh(valueAs<uint64_t>()))); break; - case 17: // BYTEAOID + case BYTEAOID: h.blob(DB::Blob(value(), length())); break; default: |