Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a lot of S57 files that need to be imported to PostgresDB. The process takes over 2 hours. In order to improve performance, I have tried using PG_USE_COPY to use copy instead of DB inserts. I am however getting the following error.

Using: GDAL 1.9.1

Env set for:

SET PGCLIENTENCODING=LATIN1

SET PG_USE_COPY=YES

Command: ogr2ogr -update -append -f "PostgreSQL" PG:"dbname='ENCTest' host='127.0.0.1' port='5432' user='postgres' password='postgres'" *.000

1/959 Processing file: US1AK90M.000 1492KB Warning 1: Attributes Radar ignored, not in expected schema. No more warnings will be issued for this dataset.

ERROR 1: COPY statement failed.

ERROR: malformed array literal: "{"02260892A1C50F"

CONTEXT: COPY bcnspp, line 1, column lnam_refs: "{"02260892A1C50F"

share|improve this question
    
Seems your need to add Radar to your schema: "Attributes Radar ignored, not in expected schema." –  Mapperz Nov 6 '12 at 15:57
    
I don't think that is the issue. When I use inserts instead of copy by removing PG_USE_COPY setting, the process has a few warnings but no errors, and goes through fine. –  Ramesh Elaiyavalli Nov 7 '12 at 2:48

2 Answers 2

up vote 1 down vote accepted

I seemed to have fixed this issue. I upgraded to GDAL 1.9.2, upgraded to Postgres 9.3 and did this on Python 2.7. I also configured the PATH variable to use GDAL ahead of Postgres as there is a GDAL version under postgres (postgis raster support).

This seemed to do the job. I am able to use COPY and retained the Client Encoding to LATIN1.

share|improve this answer

I've seen similar problems with Postgres 9.2 which has changed binary encoding. Maybe ogr does not support it yet? Can you try with another database with older Postgres version (8.4 for instance)?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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