[OSM-talk] Problems setting up Osmosis and Postgres SQL

Pelle Svensson pelle2004 at hotmail.com
Thu Feb 3 16:29:34 GMT 2011


Hi,

I'm doing something wrong when I try to configure Postgres SQL DB 
with osmosis-SNAPSHOT-r25162.

I get ERROR: permission denied for relation schema_info


Database setup on Fedora 14 64-bit:
================

sudo -u postgres psql
  
CREATE USER osm
create database osm;
GRANT ALL PRIVILEGES ON DATABASE osm TO osm;  
q\
   
sudo -u postgres createlang plpgsql osm
sudo -u postgres psql -d osm -f /usr/share/pgsql/contrib/postgis-64.sql
sudo -u postgres psql -d osm -f /usr/share/pgsql/contrib/hstore.sql
sudo -u postgres psql -d osm -f /tmp/pgsnapshot_schema_0.6.sql

Error:
====
JAVACMD_OPTIONS="-Djava.io.tmpdir=/home/pelle/temp" osmosis --read-xml file="switzerland.osm" --write-pgsql user="osm" database="osm"
Feb 3, 2011 5:23:04 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version SNAPSHOT-r25162
Feb 3, 2011 5:23:05 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Feb 3, 2011 5:23:05 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Feb 3, 2011 5:23:05 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
Feb 3, 2011 5:24:31 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
Feb 3, 2011 5:24:31 PM org.springframework.jdbc.support.SQLErrorCodesFactory <init>
INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
Feb 3, 2011 5:24:31 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-xml failed
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT version FROM schema_info]; nested exception is org.postgresql.util.PSQLException: ERROR: permission denied for relation schema_info
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:406)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:455)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:463)
    at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:471)
    at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:476)
    at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:485)
    at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForInt(SimpleJdbcTemplate.java:113)
    at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:64)
    at org.openstreetmap.osmosis.pgsnapshot.common.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:47)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetLoader.run(CopyFilesetLoader.java:78)
    at org.openstreetmap.osmosis.pgsnapshot.v0_6.PostgreSqlCopyWriter.complete(PostgreSqlCopyWriter.java:108)
    at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:110)
    at java.lang.Thread.run(Thread.java:636)
Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for relation schema_info
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:440)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:395)
    ... 12 more
Feb 3, 2011 5:24:31 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
    at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
    at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
    at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20110203/86f5d447/attachment.html>


More information about the talk mailing list