I have a problem with integer types when importing a shapefile created in OGR into PostGIS.
I started off with a field created as
ogr.OFTInteger64 in OGR/pyqgis as follows:
field_defn = ogr.FieldDefn( fld, ogr.OFTInteger64 ) lyr.CreateField ( field_defn )
The field type shows as type:
qlonglong, and type name:
Integer64 in QGIS.
But after importing the shapefile into PostGIS with
shp2pgsql -Id -s 4326 my_lyr.shp my_lyr | psql
the field ended up being a
double precision field in
\d+, and I had to convert values in this field back to
BIGINT before use.
According to PostgreSQL documentation, both
double precision are types 8 byte (64 bit). How can I avoid the confusion and get the intended
BIGINT field in PostGIS?