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 1h1QY1-0002to-IO for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2019 07:01:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1QXz-00081Q-Vm for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2019 07:00:59 +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 1h1QXz-0007za-PU for pgsql-bugs@lists.postgresql.org; Wed, 06 Mar 2019 07:00:59 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1QXw-000410-Uh for pgsql-bugs@lists.postgresql.org; Wed, 06 Mar 2019 07:00:59 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x2670pMd019911; Wed, 6 Mar 2019 16:00:51 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 72018638B8A; Wed, 6 Mar 2019 16:00:51 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 63605638B48; Wed, 6 Mar 2019 16:00:51 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 4CCB240069C; Wed, 6 Mar 2019 16:00:51 +0900 (JST) Subject: Re: BUG #15668: Server crash in transformPartitionRangeBounds References: <15668-0377b1981aa1a393@postgresql.org> <20190306064825.GH30982@paquier.xyz> From: Amit Langote Message-ID: <6ed2c24c-2f73-fa1c-0ed1-ed3597f13d0d@lab.ntt.co.jp> Date: Wed, 6 Mar 2019 16:00:42 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190306064825.GH30982@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Michael Paquier , Amit Langote Cc: exclusion@gmail.com, PostgreSQL mailing lists , PostgreSQL-development , Peter Eisentraut X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019/03/06 15:48, Michael Paquier wrote: > On Tue, Mar 05, 2019 at 11:04:17PM +0900, Amit Langote wrote: >> Maybe we should error out as follows in >> transformPartitionRangeBounds(), although that means we'll get >> different error message than when using list partitioning syntax: > > Hm. I don't think that this is a good idea as you could lose some > information for the expression transformation handling, and the error > handling becomes inconsistent depending on the partition bound > strategy. It seems to me that if we cannot extract any special value > from the ColumnRef expression generated, then we ought to let > transformPartitionBoundValue() and particularly transformExprRecurse() > do the analysis work and complain if needed: > =# CREATE TABLE rp_part PARTITION OF range_parted FOR VALUES FROM > (unknown.unknown) TO (1); > ERROR: 42P01: missing FROM-clause entry for table "unknown" > LINE 1: ...p_part PARTITION OF range_parted FOR VALUES FROM > (unknown.un... > =# CREATE TABLE rp_part PARTITION OF range_parted FOR VALUES FROM > (a.a.a.a.a.a.a.a.a.a.a.a) TO (1); > ERROR: 42601: improper qualified name (too many dotted names): > a.a.a.a.a.a.a.a.a.a.a.a > LINE 1: ...p_part PARTITION OF range_parted FOR VALUES FROM > (a.a.a.a.a.... > > What about something like the attached instead? Minus the test > cases which should go to create_table.sql of course. Thanks for looking at this. Your patch seems better, because it allows us to keep the error message consistent with the message one would get with list-partitioned syntax. Thanks, Amit