Re: toast tables and toast indexes

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Godfrin, Philippe E" <Philippe(dot)Godfrin(at)nov(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: toast tables and toast indexes
Date: 2022-01-04 12:30:57
Message-ID: YdQ+AdrSqDr08RZI@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 28, 2021 at 01:10:53PM +0000, Godfrin, Philippe E wrote:
> While experimenting with toast tables I noticed that the toast index
> lands in the same tablespace as the toast table itself. Is there a
> way to make the toast indexes create in a different tablespace?

No. See create_toast_table() where the toast table and its index use
the same tablespace as the relation they depend on.

Now, you could use allow_system_table_mods and an ALTER INDEX .. SET
TABLESPACE to change that for the index, but this is a developer
option and you should *not* use that for anything serious:
https://www.postgresql.org/docs/devel/runtime-config-developer.html

"Ill-advised use of this setting can cause irretrievable data loss or
seriously corrupt the database system."
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-01-04 13:37:46 Re: [PATCH] allow src/tools/msvc/*.bat files to be called from the root of the source tree
Previous Message Michael Paquier 2022-01-04 12:22:48 Re: Converting WAL to SQL