Re: Creating a tablespace directory in recovery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: robertmhaas(at)gmail(dot)com, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Creating a tablespace directory in recovery
Date: 2009-05-01 22:38:44
Message-ID: 26704.1241217524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> ISTM that there is currently no unified policy of whether to
> automatically create the directory specified by an user.

I think it's reasonably consistent: we don't automatically recreate
directories that are likely to be symlinks to someplace outside PGDATA.
We don't know what special properties (like mount points) they're
supposed to have, and very likely we don't have the necessary
permissions to make them anyway.

> IMO, it's not so dangerous that postgres creates the directories,
> which doesn't overwrite or remove any existing data.

You might want to reflect on this old horror story ...
http://archives.postgresql.org/pgsql-hackers/2004-12/msg00628.php
http://archives.postgresql.org//pgsql-hackers/2004-12/msg00851.php

Creating a directory where there "should be one", and you don't know
why it's missing, can make things very seriously worse indeed. Joe
was lucky to get anything back out of that fiasco.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-05-01 22:42:35 Re: windows shared memory error
Previous Message Tom Lane 2009-05-01 22:24:16 Re: windows shared memory error