Skip to content

Commit

Permalink
PG: fix support for geometry/geography OID in range [2147483648, 4294…
Browse files Browse the repository at this point in the history
…967295]

Fixes #10486
  • Loading branch information
rouault committed Jul 24, 2024
1 parent 3122857 commit c04b25f
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 c04b25f

Please sign in to comment.