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

From: Julien Tachoires <julmon(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch : Allow toast tables to be moved to a different tablespace
Date: 2012-01-22 16:04:25
Message-ID: CAFEQCbEq07OopgE5xFYv2Q3eMq45hRSJkjCBO+kvpJq9NEVhow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/12/15 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
>
> Uhm, surely you could compare the original toast tablespace to the heap
> tablespace, and if they differ, handle appropriately when creating the
> new toast table?  Just pass down the toast tablespace into
> AlterTableCreateToastTable, instead of having it assume that
> rel->rd_rel->relnamespace is sufficient.  This should be done in all
> cases where a toast tablespace is created, which shouldn't be more than
> a handful of them.

Thank you, that way seems right.
Now, I distinguish before each creation of a TOAST table with
AlterTableCreateToastTable() : if it will create a new one or recreate
an existing one.
Thus, in create_toast_table() when toastTableSpace is equal to
InvalidOid, we are able :
- to fallback to the main table tablespace in case of new TOAST table creation
- to keep it previous tablespace in case of recreation.

Here's a new version rebased against HEAD.

Regards,

--
JT

Attachment Content-Type Size
set_toast_tablespace_v0.10.patch text/x-patch 49.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-01-22 16:43:34 Re: JSON for PG 9.2
Previous Message Kohei KaiGai 2012-01-22 15:48:09 PG-Strom - A GPU optimized asynchronous executor module