pgsql: Remove complaints about COLLATE clauses in partition bound value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove complaints about COLLATE clauses in partition bound value
Date: 2020-09-28 17:44:11
Message-ID: E1kMxC7-0004Pu-Qx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove complaints about COLLATE clauses in partition bound values.

transformPartitionBoundValue went out of its way to do the wrong
thing: there is no reason to complain about a non-matching COLLATE
clause in a partition boundary expression. We're coercing the
bound expression to the target column type as though by an
implicit assignment, and the rules for implicit assignment say
that collations can be implicitly converted.

What we *do* need to do, and the code is not doing, is apply
assign_expr_collations() to the bound expression. While this is
merely a definition disagreement, that is a bug that needs to be
back-patched, so I'll commit it separately.

Discussion: https://postgr.es/m/CAJV4CdrZ5mKuaEsRSbLf2URQ3h6iMtKD=hik8MaF5WwdmC9uZw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2dfa3fea88bc951d0812a18649d801f07964c9b9

Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 44 ------------------------------
src/test/regress/expected/create_table.out | 32 ++++++++++------------
src/test/regress/sql/create_table.sql | 18 ++++--------
3 files changed, 21 insertions(+), 73 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-09-28 18:12:50 pgsql: Assign collations in partition bound expressions.
Previous Message Tom Lane 2020-09-28 16:49:29 Re: __pg_log_level in anonynous enum should be initialized? (Was: pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro)