88455

How do I restore three items from a backup made using Heroku PG Backups?

Question:

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.

Recommend

  • #REF! in formula after merging a workbook in Excel
  • python random.getstate() and random.setstate()
  • Picking commit objects in Git
  • Service fabric rollback to previous version from visual stuido or service fabric explorer
  • Workflow for maintaining different versions of a webapp using git?
  • programatically use git rebase -i
  • Get a series of commits on a detached head onto a branch
  • How to Restore a old Backup from SQL Server 7 SP4 to newest SQL Server versions? [closed]
  • Visual Studio Code: DesignHostManager failed
  • What's the right way for summary write to avoid overlapping on tensorboard when restore a model
  • How to check h2 database health and corruption
  • Can I make a variable temporarily volatile?
  • Restoring deleted mysql database
  • How to resize a pixmap with XLib?
  • how to remove comments from a bash script
  • Is there a common practice to track the user session across browser window?
  • Where to save the local DB created for iphone app?
  • How can i dump blob fields from mysql tables
  • What's the syntax to inherit documentation from another indexer?
  • Open Existing DB in MySQL WorkBench
  • C#: Import/Export Settings into/from a File
  • Why the SequenceFile is truncated?
  • DIV instruction jumping to random location?
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Loading .coffee files via a view in Rails
  • Zurb Foundation _global.scss meta styles for js?
  • Create DicomImage from scratch using Dcmtk
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • How to extract text from Word files using C#?
  • How to check if every primary key value is being referenced as foreign key in another table
  • Sending data from AppleScript to FileMaker records
  • QuartzCore.framework for Mono Develop
  • RestKit - RKRequestDelegate does not exist
  • Comma separated Values
  • Error creating VM instance in Google Compute Engine
  • Hits per day in Google Big Query
  • how does django model after text[] in postgresql [duplicate]
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • How to load view controller without button in storyboard?