From 5e8a009278d215517bde88914147719f7beef99d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 9 Oct 2015 15:27:34 -0700 Subject: [PATCH] fix #3120 --- plugins/input/postgis/postgis_featureset.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/input/postgis/postgis_featureset.cpp b/plugins/input/postgis/postgis_featureset.cpp index 9e0db0ea7..6d417bef1 100644 --- a/plugins/input/postgis/postgis_featureset.cpp +++ b/plugins/input/postgis/postgis_featureset.cpp @@ -128,6 +128,10 @@ feature_ptr postgis_featureset::next() totalGeomSize_ += size; unsigned num_attrs = ctx_->size() + 1; + if (!key_field_as_attribute_) + { + num_attrs++; + } for (; pos < num_attrs; ++pos) { std::string name = rs_->getFieldName(pos);