Some time ago I needed to get a small sample of data for development and testing from a huge (production) PostgreSQL database – something like “select these 100 users and their data from other tables and dump it into a file”.
I had a hard-drive failure some time ago. The drive was in a really bad shape,
which meant that restoring the data in place is out of question.
I needed a relatively safe way to dump the disk image to another drive and
restore the filesystem there. The usual
dd(1) did not work because of a huge
number of read errors. I found
ddrescue(1), which is doing the same thing
dd but it’s way more tolerant to read errors.
A couple of months ago I was on a conference in Berlin (IIRC it was Erlang Factory). After that much time, almost everything I saw there has already evaporated out of my mind. Except one thing, that has been lingering in the back of my mind since then. It’s a quote from the presentation of Robert Virding, one of the designers of the Erlang language:
Build tools, not solutions.
Some time ago I’ve been searching for a tool for automating PostgreSQL database updates. You know the drill - creating new tables, adding columns, renaming stuff, etc. Doing these things by hand is error prone and cumbersome, and sometimes not even possible, especially if you have more than one database or if you need to share your changes with more developers.