Why not ask your question on the new OpenStreetMap Community Forum?


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

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
accept rate: 28%

Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 21 Mar '13, 07:59

question was seen: 10,040 times

last updated: 24 Mar '13, 09:03

powered by OSQA