From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Compare collations before merging UNION operations. |
Date: | 2024-11-19 23:26:42 |
Message-ID: | E1tDXcI-002cpJ-Db@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Compare collations before merging UNION operations.
In the dim past we figured it was okay to ignore collations
when combining UNION set-operation nodes into a single N-way
UNION operation. I believe that was fine at the time, but
it stopped being fine when we added nondeterministic collations:
the semantics of distinct-ness are affected by those. v17 made
it even less fine by allowing per-child sorting operations to
be merged via MergeAppend, although I think we accidentally
avoided any live bug from that.
Add a check that collations match before deciding that two
UNION nodes are equivalent. I also failed to resist the
temptation to comment plan_union_children() a little better.
Back-patch to all supported branches (v13 now), since they
all have nondeterministic collations.
Discussion: https://postgr.es/m/3605568.1731970579@sss.pgh.pa.us
Branch
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f286f64bcf01106fc08ea1c14252ae2c26b7d189
Modified Files
--------------
src/backend/optimizer/prep/prepunion.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2024-11-20 05:21:44 | pgsql: doc: Fix section of functions age(xid) and mxid_age(xid) |
Previous Message | noreply | 2024-11-19 22:10:47 | pgsql: Tag refs/tags/REL_14_15 was created |