NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum

Hi all

I have imported the Europe dataset in PostgreSQL with osm2pgsql, and I apply daily updates with a routine every night. Looking at the logs I keep, I believe one of the daily updates was not correctly applied. I was thinking about simply re-playing those updates (edit : all the daily updates since the failure, of course). Would this work ? From what I understand of the way osm2pgsql works it basically does inserts and deletes, so I'd say this could work, but I'd rather be sure.

Thanks for your help on this !

asked 05 Mar '19, 07:55

codata_al's gravatar image

accept rate: 0%

edited 05 Mar '19, 08:38

osm2pgsql's update process is safe to replay. That means you can repeat updates provided you reapply all updates from the date that the update process failed and you apply them in the correct order. The database is only back to a consistent state when all updates have been processed.

permanent link

answered 05 Mar '19, 11:44

lonvia's gravatar image

accept rate: 40%

edited 05 Mar '19, 12:07

SomeoneElse's gravatar image

SomeoneElse ♦

That's excellent news Lonvia !

Thanks for your help !

(05 Mar '19, 12:07) codata_al

Hi again !

Just to make sure I got this right : I've had ONE update failing (say, sequenceNumber = 2245 for instance), BUT the ones after that ran fine (2246 was applied, as well as 2247 and 2248).

It is fine to reapply all updates starting from 2245 (2245 to 2248), even though the updates from 2246 to 2248 had already been applied ?

Sorry for being so verbose, but I am not sure that my first message made it very clear that I had subsequent update successfully applied.

Thanks !

permanent link

answered 15 May '19, 09:52

codata_al's gravatar image

accept rate: 0%


Yes, that's what I meant with the answer above. If you want to reapply 2245, you must reapply 2246 to 2248 afterwards again. When all changes until 2248 are applied, your database is in a consistent state.

(15 May '19, 10:13) lonvia

Great, just wanted to be 100% sure. Sorry for the noise, and thanks again !

(15 May '19, 10:18) codata_al
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]( "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: 05 Mar '19, 07:55

question was seen: 1,222 times

last updated: 15 May '19, 10:18

NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum