pgsql: Code review for match_clause_to_partition_key().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Code review for match_clause_to_partition_key().
Date: 2018-06-13 20:10:35
Message-ID: E1fTC6F-0001ag-54@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Code review for match_clause_to_partition_key().

Fix inconsistent decisions about NOMATCH vs UNSUPPORTED result codes.
If we're going to cater for partkeys that have the same expression and
different collations, surely we should also support partkeys with the
same expression and different opclasses.

Clean up shaky handling of commuted opclauses, eg checking the wrong
operator to see what its negator is. This wouldn't cause any actual
bugs given a sane opclass definition, but it doesn't seem helpful to
expend more code to be less correct.

Improve handling of null elements in ScalarArrayOp arrays: in the
"op ALL" case, we can conclude they result in an unsatisfiable clause.

Minor cosmetic changes and comment improvements.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/91781335ede4db549a28ffb8e84d3b592eef9f2f

Modified Files
--------------
src/backend/partitioning/partprune.c | 146 +++++++++++++++++++----------------
1 file changed, 81 insertions(+), 65 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nikhil Sontakke 2018-06-14 11:02:06 Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding
Previous Message Tom Lane 2018-06-13 17:18:17 pgsql: Fix some ill-chosen names for globally-visible partition support