title: PostgreSQL: What is the fastest way to backup/restore individual tables or table partitions (data+indexes)
body: <p>I'm migrating from a proprietary dbms to PG. In the proprietary dbms, &quot;offlining&quot; and &quot;onlining&quot; data partitions is a very lightweight operation. I'm looking to implement similar functionality with PG by backup and restore of individual table (partitions). Obviously I need to avoid a performance regression. So my question is what the fastest way is of:</p>
  <ul>
  <li>Backing up a table (partition), both data and indexes</li>
  <li>Taking the table offline (meaning that the data is now gone from the database)</li>
  <li>Restoring the table (partition), both data and indexes</li>
  </ul>
  <p>Once I have some advice I can design more targeted performance comparisons. Thanks in advance for any pointers.</p>