Re: [COMMITTERS] pgsql: Add GUC temp_tablespaces to provide a default location for

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jaime Casanova" <systemguards(at)gmail(dot)com>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add GUC temp_tablespaces to provide a default location for
Date: 2007-03-17 15:36:29
Message-ID: 11500.1174145789@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-patches

"Jaime Casanova" <systemguards(at)gmail(dot)com> writes:
> On 3/5/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> In the second place, it's a serious violation of what little modularity
>> and layering we have for fd.c to be calling into commands/tablespace.c.
>> This is not merely cosmetic but has real consequences: one being that
>> it's now unsafe to call OpenTemporaryFile outside a transaction.

> ok, you are right... what do you suggest?
> maybe move the GetTempTablespace function to somewhere in src/backend/utils?

You missed the point entirely. Relocating the code to some other file
wouldn't change the objection: the problem is that fd.c mustn't invoke
any transactional facilities such as catalog lookups. It's too low
level for that.

You could perhaps do it the other way around: some transactional
code (eg the assign hook for a GUC variable) tells fd.c to save
some private state controlling future temp file creations.

BTW, if we are now thinking of temp files as being directed to
particular tablespaces, is there any reason still to have per-database
subdirectories for them? It might simplify life if there were just
one default temp directory, $PGDATA/base/pgsql_tmp/, plus one per
configured temp tablespace, $PGDATA/pg_tblspc/NNNN/pgsql_tmp/.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2007-03-17 17:11:41 pgsql: msvc build actually needs Bison 2.2 or later, not 2.1.
Previous Message User Eggyknap 2007-03-17 15:16:50 pgsnmpd - pgsnmpd: Starting to resurrect the build

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-17 15:45:23 Re: CREATE INDEX and HOT (was Question: pg_class attributes and race conditions ?)
Previous Message Michael Meskes 2007-03-17 15:29:50 Re: SoC ECPG Enhancements

Browse pgsql-patches by date

  From Date Subject
Next Message Nikolay Samokhvalov 2007-03-17 15:46:28 Re: [PATCHES] xpath_array with namespaces support
Previous Message Jaime Casanova 2007-03-17 15:10:38 Re: [COMMITTERS] pgsql: Add GUC temp_tablespaces to provide a default location for