Re: How to move tables in another physial place

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to move tables in another physial place
Date: 2007-05-22 18:25:33
Message-ID: 4653359D.8090803@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/22/07 12:58, Michelle Konzack wrote:
> Am 2007-05-22 12:45:23, schrieb Ron Johnson:
>> Your subject says "physial place", but then you ask about moving a
>> table to another partition.
>>
>> Since partitions are sub-sections of tables, I don't understand what
>> you are asking.
>
> :-)
>
> INSIDE the postgresql I use table partitioning but the whole database
> is on ONE PHYSICAL partition (/dev/sdb1) in the moment.
>
> I know tablespace and want to move parts of the Maintable (which is
> cutted down in many smaler parts) on another PYSIACAL partitonon of
> /dev/sdc1, /dev/sdd1 and /dev/sde1 to reduce the seeks on the drives.
>
> But since the database IS on ONE PYSIACAL partiton I do not know,
> HOW TO MOVE some of the smaller tables (without stoping the PostgreSQL
> from operating since it is needed 24/7)

Since PostgreSQL doesn't use raw partitions, your database can't
"own" it. (Although, obviously, Postgres files might be the only
ones on sdb1.)

Is Maintable composed of smaller tables?

Anyway, this is what you need:
http://www.postgresql.org/docs/8.2/interactive/sql-altertable.html
ALTER TABLE foo SET TABLESPACE bar;

- --
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGUzWdS9HxQb37XmcRAoSEAKDuKTJi/yFuQcVdWKKzVTPzzJMs4ACfUqzM
Rpd+Xf4/2o1b6mo5xgm8AXQ=
=ASU2
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Fitzpatrick 2007-05-22 18:30:37 Re: Permance issues with migrated db
Previous Message Richard Huxton 2007-05-22 18:13:16 Re: swap storm created by 8.2.3