Re: dump, drop database then merge/aggregate
Steven Siebert <[email protected]>
| Newsgroups | gmane.comp.db.mysql.general |
|---|---|
| Message-ID | <CAC3nzejLnB8hR_ULXWxWbn0EP-3QJpXXE+u1UQA11WWs6J7vrA@mail.gmail.com> |
Totally with you, I had to get up and wash my hands after writing such filth =) On Mon, Feb 29, 2016 at 12:14 PM, Gary Smith <[email protected]> wrote: > On 29/02/2016 16:32, Steven Siebert wrote: > >> >> At risk of giving you too much rope to hang yourself: if you use >> mysqldump to dump the database, if you use the --replace flag you'll >> convert all INSERT statements to REPLACE, which when you merge will update >> or insert the record, effectively "merging" the data. This may be one >> approach you want to look at, but may not be appropriate depending on your >> specific situation. >> >> I'd considered mentioning this myself, but this was the root of my > comment about integrity - if the original database or tables are dropped, > then the replace command will cause the data to poo all over the original > dataset. As you mentioned in your (snipped) reply, this can go badly wrong > in a short space of time without the correct controls in place. Even if > they are in place, I'd have trouble sleeping at night if this were my > circus. > > Gary >