duckdb / duckdb/duckdb-spatial
Invalid endian flag value encountered on INSERT
- Dominant language
- C
- Stars
- 708
- Forks
- 96
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
I'm using duckdb-spatial in python to select data from an ESRI personal geodatabase and insert it into a PostGIS Table.
My Query basically looks like this
```sql
INSERT INTO db.a_schema.a_geo_layer BY NAME
SELECT
'SRID=31287;' || ST_AsText(ST_Force2D(ST_MULTI(geom))) as geom
, COLUMNS('EDVKZ|KURZRID|LANDRID|GGN_VERS|AK_DATUM|L_KATEGO|SZENARIO|INFO_TXT|DATENQUELLE')
FROM ST_Read('path/to/some.gdb', layer='A_GEO_LAYER', keep_wkb=false) a
```
There are also variants where I make use of `keep_wkb=true` and `TRY_CAST(geom)` because of ARC Geometries in the ESRI datasource. I thought that might explain the error because I was casting binary data, but I was also able to reproduce this error without any binary casting involved like above.
I have to create an EWKT out of the geometry because thats the only way to feed an proper Geometry with defined SRID to the PostGIS destination table. I'll file another issue to support ST_SetSRID() properly. The destination table is connected via an ATTACHED Postgres extension connection btw.
When I run my Python script on my Manjaro Linux Box I get the following Error:
_Failed to copy data: ERROR: Invalid endian flag value encountered._
When I run the very same script on Windows, it works perfectly well.
Environment:
OS: Manjaro Linux 25 / Windows 10
Python: 3.12.10
DuckDB 1.2.1
Postgres 11 / PostGIS 2.5.3 / GEOS 3.8 (yeah, thats quite old, I know)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.