Skip to content

Commit 2b1b204

Browse files
committed
Postgres array indicies start at 1, not 0
1 parent 9a51260 commit 2b1b204

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/oatpp-postgresql/mapping/Serializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void Serializer::serializeArray(const Serializer* _this, OutputData& outData, co
415415
pgArray->header._ign = 0;
416416
pgArray->header.oid = htonl(FLOAT8OID);
417417
pgArray->header.size = htonl(v->size());
418-
pgArray->header.index = 0;
418+
pgArray->header.index = htonl(1); // postgres arrays are indexed 1..N by default
419419

420420
// stuff in the elements in network order
421421
auto *elemBuff = reinterpret_cast<p_uint8>(pgArray->elem);

0 commit comments

Comments
 (0)