Silent failure attempting to read invalid characters from Postgres
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)
Description: |
modified (diff)
|
Version: |
unspecified → 1.10.0
|
Milestone: |
→ 2.0
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
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.