Skip to content

Commit

Permalink
Merge pull request #10488 from rouault/fix_10486
Browse files Browse the repository at this point in the history
PG: fix support for geometry/geography OID in range [2147483648, 4294967295]
  • Loading branch information
rouault committed Aug 10, 2024
2 parents c90bb9d + c04b25f commit 7e1c209
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ogr/ogrsf_frmts/pg/ogrpgdatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,12 +831,12 @@ int OGRPGDataSource::Open(const char *pszNewName, int bUpdate, int bTestOpen,
if (EQUAL(pszTypname, "geometry"))
{
bHavePostGIS = TRUE;
nGeometryOID = atoi(pszOid);
nGeometryOID = static_cast<Oid>(strtoul(pszOid, nullptr, 10));
}
else if (CPLTestBool(CPLGetConfigOption("PG_USE_GEOGRAPHY", "YES")))
{
bHaveGeography = TRUE;
nGeographyOID = atoi(pszOid);
nGeographyOID = static_cast<Oid>(strtoul(pszOid, nullptr, 10));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ogr/ogrsf_frmts/pg/ogrpglayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ OGRFeature *OGRPGLayer::RecordToFeature(PGresult *hResult,
for (int iField = 0; iField < PQnfields(hResult); iField++)
{
#if defined(BINARY_CURSOR_ENABLED)
int nTypeOID = PQftype(hResult, iField);
const Oid nTypeOID = PQftype(hResult, iField);
#endif
const char *pszFieldName = PQfname(hResult, iField);

Expand Down

0 comments on commit 7e1c209

Please sign in to comment.