pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Chris Drawater <Chris.Drawater@viavisolutions.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: 12.1 Partitioned Table Creation Bug
Date: Thu, 23 Jan 2020 12:48:03 -0300
Message-ID: <20200123154803.GA12304@alvherre.pgsql> (raw)
In-Reply-To: <31928.1579735064@sss.pgh.pa.us>

On 2020-Jan-22, Tom Lane wrote:

> Poking into it, I can reproduce Chris' failure in the specific case
> where default_tablespace is explicitly set to "pg_default" rather
> than being left empty.
> 
> You're right that this is new behavior in v12; it seems to have been
> introduced by commit 87259588d, which quoth
>     
>     * Setting a partitioned rel's tablespace to the database default is
>       confusing; if it worked, it would direct the partitions to that
>       tablespace regardless of default_tablespace.  But in reality it does
>       not work, and making it work is a larger project.  Therefore, throw
>       an error when this condition is detected, to alert the unwary.
> 
> I wouldn't say that this behavior is "alerting the unwary"; it's just
> confusing them --- and the case that this is less confusing than what
> happened before seems pretty thin.
> 
> Maybe a better error message would improve matters.  But I'm inclined
> to say that reverting this aspect of the patch would be a better idea.
> I find it particularly bletcherous that it made GetDefaultTablespace()
> know whether it's operating to select a tablespace for a partitioned
> relation or some other case --- that is just awful design, and it doesn't
> make me feel that the whole idea was especially well thought out.

A partitioned relation behaves differently from other relations in the
storage regard, so I don't find particularly surprising that
GetDefaultTablespace behaves differently for them.

I think randomly, carelessly reverting parts of the patch would be a
terrible idea, because it was difficult to arrive at the current
behavior; all other behaviors had different problematic corner cases.
I invite people to read the discussion to led to the current design.

As the quoted commit message indicates, it *is* possible to make this
configuration/command combination work, but it's not as trivial as
reverting a few lines of a commit.  Again, I suggest to reread the old
thread for some insight.  In particular,
https://postgr.es/m/20190423222633.GA8364@alvherre.pgsql

The fact remains that partitioned tables were left to work poorly in
many cases, and we made great efforts to improve them.  Some casualties
were left along the way, mostly in the area of backwards compatibility.
I didn't shed tears for those, and nobody should either: in pg10 we got
partitioning, which was a huge effort and I applaud that, but it was
just the beginning and we knew full well that it had wrinkles that we'd
have to iron out later on.  That is what we were doing in the discussion
that led to commit 87259588d.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (5+ messages)

Message-ID: <20200123154803.GA12304@alvherre.pgsql>
Permalink:  ../20200123154803.GA12304@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200123154803.GA12304@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, Chris.Drawater@viavisolutions.com
  Subject: Re: 12.1 Partitioned Table Creation Bug
  In-Reply-To: <20200123154803.GA12304@alvherre.pgsql>
  References: <31928.1579735064@sss.pgh.pa.us> <20200123154803.GA12304@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox