In FME-form, when executing a vanilla PostGIS reader connected to a PostgreSQL + PostGIS table, I encounter this error:

ERROR | Error executing SQL command ('FETCH 10000 IN "public_table_crsr"'): 
  'ERROR:  Invalid endian flag value encountered.

While this is raised in the PostgreSQL log:

[10981] ERROR:  relation "raster_columns" does not exist at character 64
[10981] STATEMENT:  SELECT r_table_name, r_raster_column, '2', srid, 'RASTER' FROM raster_columns WHERE r_table_schema = 'public'   AND r_table_name   = 'table'
[10981] ERROR:  Invalid endian flag value encountered.
[10981] STATEMENT:  FETCH 10000 IN "public_table_crsr"

The geometry column is of type ST_Point, using the EPSG:2056 crs. There is no NULL value. Every geometry is valid.

What could be wrong with my dataset and how could I debug this?

If this can help, prior to the error shown above by FME; this WARNING is showing up:

Failed to retrieve geometry type from hex WKB string due to invalid byte order value '53'. Must be either '00' or '01'

The database table was initially created using ogr2ogr from an ESRI file GDB (the file GDB itself can be read without any problem in FME using a Esri Geodatabase (File Geodb Open API)):

ogr2ogr -f "PostgreSQL" "PG:${connection_uri}" "${file}"


FME: 2023.0.0.1 (20230501 - Build 23288 - linux-x64
PostgreSQL 16.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
GDAL/OGR: GDAL 3.6.3, released 2023/03/07

POSTGIS="3.4.1 0"
    WAGYU="0.5.0 (Internal)"
  • 1
    FME tries to read raster data from PostGIS but it seems that you are interested in vectors.
    – user30184
    Mar 7 at 20:09

1 Answer 1


I finally figured out what's going on.

In PostgreSQL I have 16 tables in my schema, from A to P. 2 of them (A and B) are geometric table, all other are non-geometric tables.

When creating a PostGIS reader in FME, it should only see and allow to load those two tables A and B with geometries, but it actually also see one of the non-geometric tables (this is definitely a bug). I didn't noticed that. So it loaded three tables.

Then when clicking the green arrow (available when cache is ON) on top of the first Feature Type yellow box (i.e. the first geometry table) to see what's in there, I don't know why, but FME also tried to fetch some data in the two others, and when trying to do some operation related to the geometric field on the non-geometric table, it failed with the mentioned error.

Removing the non-geometric table from the PostGIS reader solved the issue.

Lesson learned

Always double check what FME loads when using a PostGIS reader because for obscure reasons, it may also load a non geometric table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.