Closed mhkeller closed 9 months ago
I have no idea - kinda bizzare they change OIDs on columns based on the projection (I'm assuming you're using ST_SetSRID
)? This really isn't specific to this library at all...I never really ended up relying on OIDs for much outside of the very standard columns because things get weird. I remember stuff like enums and other things also being kinda "dynamic" oids. Honestly didn't dive extremely deep into, just was like "yeah no that seems outta scope"
Yea pretty weird indeed. I wasn't using ST_SetSRID
, I was just using shp2pgsql
, which maybe uses that internally? I imagine ST_SetSRID
would have the same effect. I'll keep playing around with it.
For anyone else who stumbles upon this, I think switching to the udt_name
column in the information_schema.columns
table may be a better way to go...
When importing shapefiles, the oid of the column type seems to differ based on the projection. Is there a list of all geometry type oids?
Steps to reproduce
shp2pgsql
to import it with EPSG code 2263shp2pgsql -s 2263 nybb public.nybb
select * from nybb
and the oid returned bynode-pg
for thegeom
column will be18696
If you repeat step 3 but omit the
-s 2263
and requery, the oid will be30497
. If you set the epsg to4326
, the oid will be22668
.Looking at the
pg_types
table, I don't see those oids even as options. Where do these come from and is there a list so that I can know whether the column type I'm querying is geometry?