Re: How about a proper TEMPORARY TABLESPACE? - Mailing list pgsql-hackers

From Matheus de Oliveira
Subject Re: How about a proper TEMPORARY TABLESPACE?
Date
Msg-id CAJghg4KJ_QhicSpJauwMLnFi5E9m=Nnd4TvmAyRrW04yOwf=VA@mail.gmail.com
Whole thread Raw
In response to Re: How about a proper TEMPORARY TABLESPACE?  (Matheus de Oliveira <matioli.matheus@gmail.com>)
Responses Re: How about a proper TEMPORARY TABLESPACE?  (Craig Ringer <craig@2ndquadrant.com>)
Re: How about a proper TEMPORARY TABLESPACE?  (Fujii Masao <masao.fujii@gmail.com>)
Re: How about a proper TEMPORARY TABLESPACE?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Hi Hackers,

I have worked on that patch a little more. So now I have functional patch (although still WIP) attached. The feature works as following:

- Added a boolean parameter "only_temp_files" to pg_tablespace.spcoptions;
- This parameter can be set to true only during CREATE TABLESPACE, not on ALTER TABLESPACE (I have thought of ways of implementing the latter, and I'd like to discuss it more latter);
- On the creation of relations, it is checked if it is a temporary-tablespace, and an error occurs when it is and the relation is not temporary (temp table or index on a temp table);
- When a temporary file (either relation file or sort/agg file) is created inside a temporary-tablespace, the entire directories structure is created on-demand (e.g. if pg_tblspc/<oid>/<TABLESPACE_VERSION_DIRECTORY> is missing, it is created on demand) it is done on OpenTemporaryFileInTablespace, at fd.c (I wonder if shouldn't we do that for any tablespace) and on TablespaceCreateDbspace, at tablespace.c.

I still haven't change documentation, as I think I need some insights about the changes. I have some more thoughts about the syntax and I still think that "TEMP LOCATION" syntax is better suited for this patch. First because of the nature of the changes I made, it seems more suitable to a column on pg_tablespace rather than an option. Second because no ALTER is available (so far) and I think it is odd to have an option that can't be changed. Third, I think "TEMP" keyword is more clear and users can be more used to it.

Thoughts?

I'm going to add the CF app entry next. Could I get some review now or after discussion about how things are going (remember I'm a newbie on this, so I'm a little lost)?

Regards,
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

Attachment

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: ALTER SYSTEM RESET?
Next
From: Pavel Stehule
Date:
Subject: Re: proposal (9.5) : psql unicode border line styles