Re: Moving database and schema to a new tablespace

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Moving database and schema to a new tablespace
Дата
Msg-id 1315508127.3556.35.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Moving database and schema to a new tablespace  (Richard Shaw <richard@aggress.net>)
Список pgsql-admin
On Thu, 2011-09-08 at 19:09 +0100, Richard Shaw wrote:
> Hi,
>
> I'm looking to move a database by using ALTER DATABASE $DB  SET TABLESPACE and i'd also like to move a schema over to
thesame new tablespace, googling around, it looks like there was a an ALTER SCHEMA $SCHEMA SET TABLESPACE command in
thepast, but apparently no longer.   I'm using Postgres 9, can anyone confirm if this is still possible, and if not,
howI can move the schema over ? 
>

ALTER SCHEMA... SET TABLESPACE never existed in PostgreSQL.

As you're using PostgreSQL 9, you can use the DO command to do something
like this. You need to find every table in the schema, and launch ALTER
TABLE... SET TABLESPACE to them. And then do the same with indexes.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


В списке pgsql-admin по дате отправления:

Предыдущее
От: Richard Shaw
Дата:
Сообщение: Moving database and schema to a new tablespace
Следующее
От: "Marc Mamin"
Дата:
Сообщение: Re: Moving database and schema to a new tablespace