Re: BUG #15668: Server crash in transformPartitionRangeBounds - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #15668: Server crash in transformPartitionRangeBounds
Date
Msg-id 20190306064825.GH30982@paquier.xyz
Whole thread Raw
In response to Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-bugs
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.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15667: "could not truncate file" error caused deleted rows to become visible
Next
From: Amit Langote
Date:
Subject: Re: BUG #15668: Server crash in transformPartitionRangeBounds