Re: patch : Allow toast tables to be moved to a different tablespace

Поиск
Список
Период
Сортировка
От Julien Tachoires
Тема Re: patch : Allow toast tables to be moved to a different tablespace
Дата
Msg-id CAFEQCbGEjp6j6-XD4C-vDaAyRHh6aMbH__BWB3kBuT505LXQyw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: patch : Allow toast tables to be moved to a different tablespace  (Jaime Casanova <jaime@2ndquadrant.com>)
Ответы Re: patch : Allow toast tables to be moved to a different tablespace  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
2011/12/13 Jaime Casanova <jaime@2ndquadrant.com>:
> On Mon, Dec 12, 2011 at 10:54 AM, Julien Tachoires <julmon@gmail.com> wrote:
>> 2011/12/10 Jaime Casanova <jaime@2ndquadrant.com>:
>>> On Mon, Nov 28, 2011 at 1:32 PM, Julien Tachoires <julmon@gmail.com> wrote:
>>>
>>>>> 2) after CLUSTER the index of the toast table gets moved to the same
>>>>> tablespace as the main table
>>>>
>>>
>>> there is still a variant of this one, i created 3 tablespaces (datos_tblspc):
>>>
>>> """
>>> create table t1 (
>>>     i serial primary key,
>>>     t text
>>> ) tablespace datos_tblspc;
>>>
>>> ALTER TABLE t1 SET TOAST TABLESPACE pg_default;
>>> CLUSTER t1 USING t1_pkey;
>>> """
>>
>> I am not able to reproduce this case, could you show me exactly how to
>> reproduce it ?
>>
>
> just as that...
> - create a table in a certain tablespace (diferent from pg_default),
> the toast table will be in the same tablespace,
> - then change the tablespace to pg_default and
> - then cluster the table...
> the toast table will be again in the same tablespace as the main table

Right, it seems to happen when the destination tablespace is the same
as the database's tbs, because, in this case, relation's tbs is set to
InvalidOid :
src/backend/commands/tablecmds.c line 8342

+    rd_rel->reltablespace = (newTableSpace == MyDatabaseTableSpace) ?
InvalidOid : newTableSpace;

Why don't just asign newTableSpace value here ?

Thanks,


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: review: CHECK FUNCTION statement
Следующее
От: Robert Haas
Дата:
Сообщение: Re: patch : Allow toast tables to be moved to a different tablespace