Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5679 closed defect (fixed)

Silent failure attempting to read invalid characters from Postgres

Reported by: dbaston Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: default Version: 1.10.0
Severity: normal Keywords:

Description (last modified by dbaston)

I've been using ogr2ogr to write MapInfo? TAB files from PostGIS. I've been prefacing my ogr2ogr commands with SET PGCLIENTENCODING=LATIN1, as recommended by the Postgresql driver page. This works great if all characters can be encoded in Latin-1. If the database contains UTF8 characters that cannot be encoded in Latin-1, ogr2ogr will write an empty TAB file without producing an error message, and will return zero. I would expect the process to fail or at least produce a warning.

Change History (4)

comment:1 Changed 7 years ago by dbaston

Description: modified (diff)

comment:2 Changed 7 years ago by dbaston

Version: unspecified1.10.0

comment:3 Changed 7 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r27784 "PG: emit errors instead of debug messages when postgres issues an error (#5679)"

The drawback of PGCLIENTENCODING=LATIN1 is that, once a recoding error occurs, postgres will close the reading cursor, so any features afterwards will not be read. A better solution would be to do the recoding on OGR side where we might just skip over features whose recoding fails.

comment:4 Changed 6 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.