Re: Report error position in partition bound check
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>,
Alexandra Wang <alexandra.wanglei@gmail.com>,
Daniel Gustafsson <daniel@yesql.se>,
PostgreSQL mailing lists <pgsql-hackers@postgresql.org>,
"Ashwin Agrawal (Pivotal)" <aagrawal@pivotal.io>
Date: 2020-09-28T17:01:36Z
Lists: pgsql-hackers
Amit Langote <amitlangote09@gmail.com> writes:
> On Fri, Sep 25, 2020 at 12:02 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Well, I agree with Peter to that extent, but my opinion is that *none*
>> of these cases ought to be errors. What we're doing here is performing
>> an implicit assignment-level coercion of the expression to the type of
>> the column, and changing the collation is allowed as part of that:
>>
>> regression=# create table foo (f1 text collate "C");
>> CREATE TABLE
>> regression=# insert into foo values ('a' COLLATE "POSIX");
>> INSERT 0 1
>> regression=# update foo set f1 = 'b' COLLATE "POSIX";
>> UPDATE 1
>>
>> So I find it completely inconsistent that the partitioning logic
>> complains about equivalent cases.
> My perhaps wrong impression was that the bound expression that is
> specified when creating a partition is not as such being *assigned* to
> the key column, but now that I think about it some more, that doesn't
> matter.
>> I think we should just rip the
>> whole thing out, as per the attached draft. This causes several
>> regression test results to change, but AFAICS those are only there
>> to exercise the error tests that I think we should get rid of.
> Yeah, I can see no other misbehavior resulting from this.
OK, I'll clean up the regression test cases and push that.
(Although this could be claimed to be a bug, I do not feel
a need to back-patch the behavioral change.)
regards, tom lane
Commits
-
Assign collations in partition bound expressions.
- 72647ac3bf0f 14.0 landed
- 61a78c71a656 13.1 landed
- 29f20db85ed2 12.5 landed
-
Remove complaints about COLLATE clauses in partition bound values.
- 2dfa3fea88bc 14.0 landed
-
Improve error cursor positions for problems with partition bounds.
- 6b2c4e59d016 14.0 landed