Re: Attaching/detaching tablespaces (or, in general, parts of a DB)

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Attaching/detaching tablespaces (or, in general, parts of a DB)
Date: 2011-04-07 02:58:20
Message-ID: 4D9D284C.3060209@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/06/11 7:05 PM, Yang Zhang wrote:
> Is it possible to attach or detach parts of a DB (e.g. tablespaces),
> such that I can flexibly move the disks containing the DB tables
> around to different hosts?
>
> The last discussion I could find on this topic is from 2007, and the
> answer was "No":
>
> http://postgresql.1045698.n5.nabble.com/Possible-to-Attach-Detach-Tablespaces-td1885602.html
>
> Wondering if there's been any change to the answer since then. I can
> alternatively dump/load, which is slower and requires 2x the disk
> space. Thanks in advance.

pg_dump -Fc somedatabase | pg_restore -h newhost newdb

voila, no temp space used.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message abhishek.itbhu2004 2011-04-07 04:12:25 Re: how to insert multiple rows and get the ids back in a temp table (pgplsql)?
Previous Message Craig Ringer 2011-04-07 02:50:58 Re: Critical Bug