Re: Use of non-restart-safe storage by temp_tablespaces

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use of non-restart-safe storage by temp_tablespaces
Date: 2017-05-30 22:50:04
Message-ID: 73F3F3FB-E03E-4C17-BB6D-36CB0B990DBB@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On May 29, 2017, at 11:53 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Right now we don't document that temp_tablespaces can use
> non-restart-safe storage, e.g. /tmp, ramdisks. Would this be safe?
> Should we document this?

The only safe way to do temporary tablespaces that I have found is to extend
the grammar to allow CREATE TEMPORARY TABLESPACE, and then refuse
to allow the creation of any non-tempoary table (or index on same) in that
tablespace. Otherwise, it is too easy to be surprised to discover that your
table contents have gone missing.

If the project wanted to extend the grammar and behavior in this direction,
maybe temp_tablespaces would work that way? I'm not so familiar with what
the temp_tablespaces GUC is for -- only ever implemented what I described
above.

Mark Dilger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Glukhov 2017-05-30 23:10:34 Re: PATCH: recursive json_populate_record()
Previous Message Tom Lane 2017-05-30 22:48:19 Re: syscache entries out of order