Skip to main content
Question

PostgreSQL bytea data is not written correctly by FeatureWriter (PostgreSQL → PostgreSQL)

  • October 5, 2026
  • 0 replies
  • 12 views

dbosyi
Observer
Forum|alt.badge.img

Hi,

I’m using FME Workbench (2025.1.3.3) to transfer data between different databases.

The workflow is as follows:

Creator → FeatureReader → DatabaseQuerier → FeatureWriter

The FeatureReader reads one feature from the source database to initialize the process. The DatabaseQuerier then executes a query against the source PostgreSQL database and returns the actual data to be written. The schema attributes are passed through the workflow, and the FeatureWriter writes the resulting features to an existing table in the destination PostgreSQL database.

The problem occurs when one of the source columns has the PostgreSQL bytea data type.

The source and destination tables have the following relevant column:

geom bytea

When both the source and destination databases are PostgreSQL, FME does not appear to transfer this binary attribute correctly.

With Bulk Insert enabled, the FeatureWriter fails with the following PostgreSQL error:

ERROR: missing data for column "geom"

The log also reports:

Bulk copy failed ... using delimiter ':'

If I disable Bulk Insert, the workspace completes successfully without any errors, but the geom column in the destination table contains NULL instead of the original binary data.

What makes this particularly interesting is that essentially the same workflow works correctly when the source database is Microsoft SQL Server and the destination is PostgreSQL. In that case, a SQL Server varbinary(max) column is transferred correctly and written to the PostgreSQL bytea column.

Therefore, the issue seems to be specific to handling PostgreSQL bytea values somewhere between DatabaseQuerier and FeatureWriter, rather than to the destination PostgreSQL bytea column itself.

I suspect that there may be an issue with how the PostgreSQL reader/querier exposes the binary value to FME, or how the PostgreSQL writer serializes it for COPY/bulk insert.

Has anyone encountered this behavior with PostgreSQL bytea attributes?

Any suggestions on how to resolve this issue would be greatly appreciated.