Re: migrating/spliting Postgres data directory on OpenIndiana

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: migrating/spliting Postgres data directory on OpenIndiana
Date: 2012-10-26 05:24:35
Message-ID: 508A1E93.5010004@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/25/12 11:46 AM, Boris Epstein wrote:
>
> At this point I tried to just move the directory and use a soft link
> to repoint to it - but so far I have not even been able to do that
> properly, using pg_ctl. Apparently the process would not die. What
> should I look into to debug this one?

try the -m fast switch to pg_ctl stop ... this tells it to cleanly
exit any pending queries and terminate the client connections. without
this, the postmaster waits for all the client apps to exit on their own,
which might be a rather long time.

stop the database server, THEN move the data directory. you can then
use a symlink, or just change your startup scripts to set $PGDATA to the
new location. if you do it that way, I suggest also setting PGDATA in
the postgres user's unix profile so commands like pg_ctl know where to look.

> And if I want to split the storage - i.e., put databases into
> different directories - can I do that?

there's little point in using different directories (tablespaces) on the
same device, but there are many scenarios where putting different
tablespaces on separate devices can be useful.

note a tablespace can be the default for a whole database (or more than
one), or it can be used on a table by table basis, so you can spread
tables across multiple file systems and physical devices.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message José Pedro Santos 2012-10-26 13:16:20 pg_wrapper error
Previous Message Thomas Munro 2012-10-26 04:55:27 Re: migrating/spliting Postgres data directory on OpenIndiana