I've got a Rails app running on Heroku and installed the free pgbackups addon.
There's three records I'd like to restore from the backup.
According to <a href="http://devcenter.heroku.com/articles/pgbackups#restoring_from_a_backup" rel="nofollow">Heroku docs</a> when you do a restore, it restores the whole database.
How do I restore just these three records?Answer1:
Create a new database, load the pgbackup into it, and then cherry pick what you want out of it.Answer2:
As far as I know Heroku is using what's referred to as the "-Fc" format for everything, which is described in the <a href="http://www.postgresql.org/docs/8.3/static/app-pgdump.html" rel="nofollow">pg_dump</a> section of the manual as the custom format. That can't be read by anything but <a href="http://www.postgresql.org/docs/8.3/static/app-pgrestore.html" rel="nofollow">pg_restore</a>, so you're limited to what it knows how to do. You can get pg_restore to only process a single table, which can speed things up if your database is big and you only care about a few records in one table. But there's no way to only get a few records restored out of there; you'll have to restore the entire table they're in and then dump them back out.