3

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"

JGH
44.4k3 gold badges49 silver badges95 bronze badges
asked Nov 6, 2012 at 15:33
2
  • Seems your need to add Radar to your schema: "Attributes Radar ignored, not in expected schema." Commented Nov 6, 2012 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. Commented Nov 7, 2012 at 2:48

2 Answers 2

1

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.

answered Nov 21, 2012 at 23:41
0

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)?

answered Nov 21, 2012 at 9:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.