Re: migrating/spliting Postgres data directory on OpenIndiana

From: Thomas Munro <munro(at)ip9(dot)org>
To: Boris Epstein <borepstein(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: migrating/spliting Postgres data directory on OpenIndiana
Date: 2012-10-26 04:55:27
Message-ID: CADLWmXW7m_7P0nUbGJcbDimMHDrfsBkizKhi4xp0umbX8Fy=qg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25 October 2012 19:46, Boris Epstein <borepstein(at)gmail(dot)com> wrote:
> And if I want to split the storage - i.e., put databases into different
> directories - can I do that?

Take a look at the tablespace feature:

http://www.postgresql.org/docs/current/static/sql-createtablespace.html

You can move existing tables with ALTER TABLE (likewise for indexes),
and change the default for new tables created in future in a database
with ALTER DATABASE:

http://www.postgresql.org/docs/9.2/static/sql-altertable.html
http://www.postgresql.org/docs/9.2/static/sql-alterdatabase.html

Before the tablespace feature was added, people used to create
symlinks in the data directory if they wanted to use different storage
for different objects (say, a special fast disk array for certain
data). The tablespace feature actually works the same way, but it's
managed for you via DDL commands.

Hope that helps,
Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2012-10-26 05:24:35 Re: migrating/spliting Postgres data directory on OpenIndiana
Previous Message Xiong He 2012-10-25 23:26:27 Re: migrate from PostgreSQL to Oracle