Re: move database from the default tablespace to a new one?

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Anton Melser <melser(dot)anton(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: move database from the default tablespace to a new one?
Date: 2008-05-16 15:15:13
Message-ID: 482DA501.4070605@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Anton Melser a écrit :
> Is this possible? I have a db that has been living in the default
> tablespace, and I am trying to separate out the transaction logs (and
> log archiving) and the data. It seems that tablespaces are the way to
> go... but the database exists and I need to separate them out. Any
> pointers?

Create a tablespace and move each individual relations of this database
in the new tablespace :
* ALTER TABLE ... SET TABLESPACE ...
http://www.postgresql.org/docs/8.3/interactive/sql-altertable.html
* ALTER INDEX ... SET TABLESPACE ...
http://www.postgresql.org/docs/8.3/interactive/sql-alterindex.html

Regards.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Denis Gasparin 2008-05-16 15:40:36 IN query operator and NULL values
Previous Message Anton Melser 2008-05-16 15:07:40 move database from the default tablespace to a new one?