discogs-xml2db icon indicating copy to clipboard operation
discogs-xml2db copied to clipboard

Updating a PostgreSQL database

Open hodgesmr opened this issue 11 years ago • 5 comments

Is there a mechanism in place for updating a PostgreSQL database from the latest XML dumps? I couldn't find anything other than what the README mentioned about MongoDB.

hodgesmr avatar Jun 16 '14 03:06 hodgesmr

Sadly no. The Discogs project doesn't give deltas to be able to easily compute updates.

philipmat avatar Jun 16 '14 03:06 philipmat

However there are two type of changes between datadumps:

  1. Existing releases/artists etc modified
  2. New releases/artists added

Because releaseids, artistids etc are sequential if you were only interested in -2 you could just say insert releases whose id is greater then the current id in the database , and so on for artists etc.

If you were interested in -1 as well if you had the the previous dump files there could be the possibility to compare each record in one dump with another and only update (or insert delete) if different.

So I think there is the possibility to do something

ijabz avatar Jun 25 '14 09:06 ijabz

I like the id idea, even if it introduces a higher complexity. Alternatively, I guess we could compute a checksum for every top-level xml record and re-process those that have changed.

philipmat avatar Feb 24 '17 15:02 philipmat

However there are two type of changes between datadumps:

  1. Existing releases/artists etc modified
  2. New releases/artists added

There is also releases/artists removed or merged.

pfouque avatar Feb 27 '17 10:02 pfouque

When the records get removed or merged are they actually removed from the dump or just their status gets marked somehow?

philipmat avatar Feb 27 '17 12:02 philipmat