Re: make default TABLESPACE belong to target table. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: make default TABLESPACE belong to target table.
Date
Msg-id 12920.1480177006@sss.pgh.pa.us
Whole thread Raw
In response to Re: make default TABLESPACE belong to target table.  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: make default TABLESPACE belong to target table.  (Amos Bird <amosbird@gmail.com>)
Re: make default TABLESPACE belong to target table.  (Michael Paquier <michael.paquier@gmail.com>)
Re: make default TABLESPACE belong to target table.  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Amit Kapila <amit.kapila16@gmail.com> writes:
> What will such a storage parameter (default_tablespace) mean at table
> level and how it will different from existing default_tablespace?  I
> think the usage asked by Amos is quite genuine, but not sure if
> introducing default_tablespace as a storage level parameter is the
> best way to address it.  Another way could be that we allow the user
> to specify something like tablespace_name <inherit parent>/<inherit
> table> or something like that.

That seems overcomplicated, and it will also pose quite some hazard
for pg_dump for example.  It feels like "action at a distance", in
that creation of an index will now depend on properties that aren't
immediately obvious.

I was thinking about introducing a new GUC, named something like
default_index_tablespace, which would need to have at least these
behaviors:

1. index tablespace is same as default_tablespace (the backwards
compatible, and therefore the default, behavior).

2. index tablespace is same as table's tablespace.

3. default_index_tablespace names a specific tablespace.

Point 3 isn't in the current request but I'm pretty sure I've heard
it requested in the past, so that people can conveniently put all
tables in tablespace X and all indexes in tablespace Y.

If we just did points 1 and 2 then a bool GUC would suffice.  I'm
not sure how to handle all three cases cleanly.  We could define
default_index_tablespace as empty to get point 1 or a tablespace
name to get point 3, but that leaves us having to use some magic
string for point 2, which would be messy --- what if it conflicts
with someone's choice of a tablespace name?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Skipping PgStat_FunctionCallUsage for many expressions
Next
From: Tom Lane
Date:
Subject: Wrong order of tests in findDependentObjects()