Re: tablespaces inside $PGDATA considered harmful - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: tablespaces inside $PGDATA considered harmful
Date
Msg-id 20150130171920.GJ3854@tamriel.snowman.net
Whole thread Raw
In response to tablespaces inside $PGDATA considered harmful  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
* Robert Haas (robertmhaas@gmail.com) wrote:
> Given all this, it seems like a good idea to at least give a warning
> if somebody tries to create a tablespace instead the data directory.

A warning seems like a good idea.  I actually thought we *did* prevent
it..

> Arguably, we should prohibit it altogether, but there are obviously
> people that want to do it, and there could even be somewhat valid
> reasons for that, like wanting to set per-tablespace settings
> differently for different tablespaces.  Possibly we should prohibit it
> anyway, or maybe there should be an option to create a tablespace
> whose directory is a real directory, not a symlink.  So then:
>
> CREATE TABLESPACE foo LOCATION '/home/rhaas/pgdata/pg_tblspc/foo';
>
> ...would fail, but if you really want a separate tablespace inside the
> data directory, we could allow:
>
> CREATE TABLESPACE foo NO LOCATION;
>
> ...which would just create a bare directory where the symlink would normally go.

I actually really like this 'NO LOCATION' idea.  Are there reasons why
that would be difficult or ill-advised to do?

I could see the NO LOCATION approach being useful for migrating between
systems, in particular, or a way to have pg_basebackup work that doesn't
involve having to actually map all the tablespaces...
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: tablespaces inside $PGDATA considered harmful
Next
From: Robert Haas
Date:
Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission