A week ago, I used Osmosis to import osc files into PostgreSQL with this code:
All went well, and today I tried to run this code with a different osc file, and it failed with this error message: ... SEVERE: Thread for task 1-rxc failed org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO nodes(id, version, user_id, tstamp, changeset_id, tags, geom) VALUES (?, ?, ?, ?, ?, ?, ?)]; nested exception is org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.HashMap. Use setObject() with an explicit Types value to specify the type to use. ... Can you help solve this? I have a pgsnapshot schema with the linestring.sql, Osmosis version is 0.45, PostgreSQL version is 9.5.6, PostGIS version: 2.3.3 Thank you! asked 13 Sep '17, 17:14 horvatha |
i have the same exact error and its driving me crazy!! i wish i can help you but i also posted this question. If i get an answer myself i will be sure to share it with you! Im curious though, you were able to get it work once for you, then now it doesnt work? From the very first time i tried to apply a change file i started receiving this error. The only difference with error is the sql query. Mine is this
[UPDATE nodes SET id = ?, version = ?, user_id = ?, tstamp = ?, changeset_id = ?, tags = ?, geom = ? WHERE id = ?]
I installed osmosis 0.40.1 with apt install osmosis and now it works. Installed the pgsnapshot_schema.sql and linestring.sql (version 0.6). No more error messages. Hope it will work for you, too!