Re: moving tablespaces

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Grzegorz Dostatni <dostatnig(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: moving tablespaces
Date: 2008-04-07 21:48:22
Message-ID: 20080407144822.21c8bcbb@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 7 Apr 2008 14:15:02 -0700 (PDT)
Grzegorz Dostatni <dostatnig(at)yahoo(dot)com> wrote:

> Hello.
>
> I'm running postgresql 8.3.1 on Solaris 10.
>
> I made a mistake when originally setting up the
> database directory (which includes tablespaces). I
> have moved it to a new location, and I have setup a
> symbolic link that allows the db to find the
> tablespaces. What I'm wondering about is how do I make
> the change pernament in the database (ie. without
> using symbolic links)?
>
> What's the safe way to do that?
>
> Is moving the symbolic links from pg_tblspc area
> sufficient? DB needs to be shutdown for that. Will
> that update the pg_tablespace table within the
> database automatically?

Create a new tablespace and move the objects to it (alter table <foo>
tablespace ....). However this will be an exclusive lock for each object
as the task is performed.

Sincerely,

Joshua D. Drake

>
> Thanks,
>
> Greg
>
>
> ____________________________________________________________________________________
> You rock. That's why Blockbuster's offering you one month of
> Blockbuster Total Access, No Cost.
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
>

--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Phillip Smith 2008-04-08 04:24:34 Re: Import from CSV
Previous Message Grzegorz Dostatni 2008-04-07 21:15:02 moving tablespaces