Re: Tablespaces in the data directory

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tablespaces in the data directory
Date: 2012-12-03 00:50:11
Message-ID: CABUevEwDeuJ8vadDegcRyR2A-skcZM7WVzz01EP1wPUMg7Pomg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 1, 2012 at 6:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Someone just reported a problem when they had created a new tablespace
>> inside the old data directory. I'm sure there can be other issues
>> caused by this as well, but this is mainly a confusing scenario for
>> people now.
>
>> As there isn't (as far as I know at least) any actual *point* in
>> creating a tablespace inside the main data directory, should we
>> perhaps disallow this in CREATE TABLESPACE? Or at least throw a
>> WARNING if one does it?
>
> It could be pretty hard to detect that in general (think symlinks
> and such). I guess if we're just trying to print a helpful warning,
> we don't have to worry about extreme corner cases. But what exactly
> do you have in mind --- complain about any relative path? Complain
> about absolute paths that have a prefix matching the DataDir?

Oh, I hadn't thought quite so far as the implementation :) Was looking
to see if there were going to be some major objections before I even
started thinking about that.

But for the implementation, I'd say any absolute path that have a
prefix matching DataDir. Tablespaces cannot be created using relative
paths, so we don't have to deal with that.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-12-03 01:55:28 Re: Tablespaces in the data directory
Previous Message Marko Tiikkaja 2012-12-02 23:24:48 Re: Materialized views WIP patch