Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 80FB42E2EB6 for ; Mon, 3 Dec 2007 17:42:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 30904-04-7 for ; Mon, 3 Dec 2007 17:42:32 -0400 (AST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by postgresql.org (Postfix) with ESMTP id 40C5A2E02FD for ; Mon, 3 Dec 2007 17:22:07 -0400 (AST) Received: by wa-out-1112.google.com with SMTP id m38so6082742waf for ; Mon, 03 Dec 2007 13:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=FIvRmH48GVo6Z2o5QrIJEQuKB0wXfIhbpNG/ZqT72oY=; b=uy1sL0Anv4Zi5ssfxREueovi1Lj6CjwCLaEUxN2G57C1q32Tq6WGIEoLFzhL4IkLLL01l2MpxhKQEJeupWFDNSsBw1yOW7B9U0iAZeOgN4xmyKiCYI2a0x8QaXzY7tRkFlgNYg9JyknTHzNPiCuHN5olGjUwLseNYNwgLXiWzK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ivKuFFXwO4vMO55BJmB7poYYWQ8XN5VoEai+8nU8qyaiUvH7lK8zHtTqh+ZsUnti7YXz37pnswJX8tWqOjPVR/yaiuXYRUCJcC4ik639vYgBXmMWE5QluaNL3uG6YY8qsEOM7azP1KY26W+JSpLaNl8PFTsOgsQyy4RQNU6VF0I= Received: by 10.114.123.1 with SMTP id v1mr3748534wac.1196716925871; Mon, 03 Dec 2007 13:22:05 -0800 (PST) Received: by 10.114.53.7 with HTTP; Mon, 3 Dec 2007 13:22:05 -0800 (PST) Message-ID: Date: Mon, 3 Dec 2007 15:22:05 -0600 From: "Scott Marlowe" To: "David Young" Subject: Re: Is there an easy and safe way to migrate a database to a new tablespace? Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/7 X-Sequence-Number: 27524 On Nov 26, 2007 3:05 PM, David Young wrote: > Hi, > > I recently converted to using a postgresql engine that support tablespaces. > There's a database that I would like to move to a new tablespace for > performance reasons. What is the safe and correct way of doing this? The > documentation is a bit sketchy on this. I think you'd have to first set a new default_tablespace for the db, then you'd have to write a script to go through each object and move it with an alter (table|index) to the new tablespace.