NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi,

I am trying to import a 2GB .osm file to a new empty postgresql database but the command I use fails and I have no idea why. This is the command:

osmosis --read-xml file="D:\Licenta\Romania OSM\romania.osm" --write-pgsql host="localhost" database="romania" user="postgres" password="mypassword"

This is the error I get:

...

SEVERE: Thread for task 1-read-xml failed org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL gram mar [SELECT version FROM schema_info]; nested exception is org.postgresql.util.P SQLException: ERROR: relation "schema_info" does not exist Position: 21 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.d oTranslate(SQLErrorCodeSQLExceptionTranslator.java:233)

...

Thank you

asked 21 Mar '13, 07:59

raduzugravu's gravatar image

raduzugravu
316610
accept rate: 0%


You need to create the correct schema (i.e. create the database tables) first. One of the tables (i.e. relations) created will be called "schema_info", which osmosis checks before it loads anything, and that's where the error 'relation "schema_info" does not exist' comes from.

Please have a read of the osmosis documentation on the PostgreSQL tasks. You will need to choose which of the schemas is appropriate for your task, then load the schema (e.g. psql -d romania -f /path/to/schema.sql) then load the data.

permanent link

answered 24 Mar '13, 09:03

Andy%20Allan's gravatar image

Andy Allan
12.5k23128153
accept rate: 28%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×196

question asked: 21 Mar '13, 07:59

question was seen: 10,908 times

last updated: 24 Mar '13, 09:03

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum