Skip site navigation (1) Skip section navigation (2)

Re: create tablespace fails silently, or succeeds improperly

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create tablespace fails silently, or succeeds improperly
Date: 2010-12-11 18:15:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sat, Dec 11, 2010 at 10:56 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
>> * Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
>>> On Fri, Dec 10, 2010 at 10:33 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> Anybody have a problem with adopting this behavior?
>>> Seems a bit surprising.
>> Yeahh..  I'm not really sure about mkdir -p type actions from a SQL
>> command.  Not entirely sure why but it doesn't feel 'right' to me.  I'd
>> rather have PG complain "that directory doesn't exist".
> OK.  Is there any value in doing mkdir -p in WAL-recovery execution of
> CREATE TABLESPACE but not regular execution?

I don't think so.  If someone creates a directory that is not fsync'd,
and then creates a subdirectory and puts a tablespace on it, and then
crashes after this has been WAL-logged but before the directory
entries have hit the disk, well, unlucky for them, but that's a
vanishingly rare situation.  There's no guarantee that we'd set
properties on the parent directory that would match the user's
expectation anyway, especially if SE-Linux or something is involved.

Robert Haas
The Enterprise PostgreSQL Company

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2010-12-11 18:20:59
Subject: Re: create tablespace fails silently, or succeeds improperly
Previous:From: Tom LaneDate: 2010-12-11 18:00:26
Subject: Re: [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group