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, 07:55

codata_al's gravatar image

codata_al
31114
accept rate: 0%

edited 05 Mar, 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, 11:44

lonvia's gravatar image

lonvia
5.1k14976
accept rate: 38%

edited 05 Mar, 12:07

SomeoneElse's gravatar image

SomeoneElse ♦
32.0k63330748

That's excellent news Lonvia !

Thanks for your help !

(05 Mar, 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, 09:52

codata_al's gravatar image

codata_al
31114
accept rate: 0%

2

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, 10:13) lonvia

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

(15 May, 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

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:

×205

question asked: 05 Mar, 07:55

question was seen: 309 times

last updated: 15 May, 10:18

powered by OSQA