Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iueiR-0002QN-5e for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jan 2020 15:48:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iueiP-0003bk-U6 for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Jan 2020 15:48:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iueiP-0003bc-Iu for pgsql-bugs@lists.postgresql.org; Thu, 23 Jan 2020 15:48:17 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iueiM-0003T7-KT for pgsql-bugs@lists.postgresql.org; Thu, 23 Jan 2020 15:48:17 +0000 Received: by mail-qt1-x844.google.com with SMTP id w8so2768091qts.11 for ; Thu, 23 Jan 2020 07:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=9gRbpYlfXg6zzawwbbsAWw3eL4yX9sMsJ2fwXyQZcII=; b=t+1CgFMwK0DJUpzX41qGv6YX1gRWX2SH04OZD2XBw4CIEY+okPdpRiA1q4QP3+x+ht LWtSqxKKjy4QfxUuwIO7EEkt1dE5ZFD5ScoBw6gYNMeebRpkP4LR77d02pqkheTmAw7x pNQVsQi8J5Jkp2eo8yJEY97HJOzZDa+lDwTq6NllHeJomsnkvpB20oQezPF1d+CjxJJa DH7yhGUwvUPV4CFdXFqU8JcctFFDd+S+DaZ4YiiMNSzKkL+u8kBNPJerMhj0x6ubxDh3 6rB06SHKI/9b0YJXVK1ZTaBjVHEglyZqtVaprUI3e9o+ycPKYFj+HfUg3OeubTTHC6OS P0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=9gRbpYlfXg6zzawwbbsAWw3eL4yX9sMsJ2fwXyQZcII=; b=rZAwWRwSJHMVXp2gZS+wXC2fvd8guBcYbq0nEsHO/dMV6RkA2GHfKOxXLVB/IDqAcr ddy7QRrGU9/tZWKET7pGrFGy5PkIBwj/JMMFZOXIxtvfm9uhaPE+oCIqyt2vv2f7xGpy zSZwgSC7Z7zniJA3KZT//CNSZuspcwE8/hw+xJ94rUPVjsLQ3q1syNeqKeYFNEgmNYke n4MsG1K6n8KDseX1sTAjNgiRcYHhZW3LthmX0EdWB3ghg10hDieC8aW56yzDVps4u+W3 lMdt792d77dSZdIf5VanpcYqTE+rx5bWLIs/YFc5ZzXKjxTYT26zkGRpqSdtI8kNsMii S2vQ== X-Gm-Message-State: APjAAAX8rvVv6mwcNtyeyCdqlc244esQ2uDMfI7CTFkvz6nVs9wmx4o4 Ldcproo80opRWQQHMsnNg3FGZA== X-Google-Smtp-Source: APXvYqwiJJIHdYMFlV957or4VS07QSCP4qnFoohjuKwMAg+E54TFmkyK5xFbbHl3IAAh3fXmxMFSgQ== X-Received: by 2002:ac8:2647:: with SMTP id v7mr17193069qtv.219.1579794491887; Thu, 23 Jan 2020 07:48:11 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([179.56.96.77]) by smtp.gmail.com with ESMTPSA id z4sm1023864qkz.62.2020.01.23.07.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 07:48:11 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id E3C9E300A9E; Thu, 23 Jan 2020 12:48:03 -0300 (-03) Date: Thu, 23 Jan 2020 12:48:03 -0300 From: Alvaro Herrera To: Tom Lane Cc: "David G. Johnston" , Chris Drawater , "pgsql-bugs@lists.postgresql.org" Subject: Re: 12.1 Partitioned Table Creation Bug Message-ID: <20200123154803.GA12304@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <31928.1579735064@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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