| From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
|---|---|
| To: | Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> |
| Cc: | Richard Guo <guofenglinux(at)gmail(dot)com>, Tender Wang <tndrwang(at)gmail(dot)com>, syzhong16(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation |
| Date: | 2026-09-10 21:54:46 |
| Message-ID: | CAPpHfdsynTShGSUfXTuXNmqtExHOxvOBVW0Cto685Qm65tKPRA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Thu, Sep 10, 2026 at 10:56 AM Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> wrote:
> On backpatch the C change applies cleanly through 14. The regress
> SQL hunks also apply, but the EXPLAIN text is not identical across
> branches even when the counts are. I checked REL_19 through REL_14
> with --with-icu. After the fix the counts are 1/1/1 and 3 everywhere.
> The EXPLAIN differences are:
>
> - Unique Sort Key on REL_18 and older prints
> ((test2cs.x)::text) COLLATE case_insensitive
> where master/REL_19 print test2cs.x COLLATE case_insensitive
>
> - unique-index case on REL_17 through REL_14 comes out as
> Hash Semi Join rather than Hash Right Semi Join
>
> So the backpatch will need a small expected.
OK, I'll take care about this during backpatching.
I also like idea of usage of enable_sort all the version in this case.
This would simplify backpatching and reduce divergence between
versions.
I made two changes to the patch.
1) Dropped the two filler rows in test1cs. They were needed back when
that block used a private two-row table; test1cs already has four
rows. That's enough to get the desired plan.
2) Dropped "ALTER TABLE test2cs ALTER COLUMN x RESET (n_distinct)".
With no ANALYZE after it, it does not restore the statistics anyway,
and nothing later in the file reads test2cs.
I plan to push this and backpatch through 14, adjusting the expected
file per branch along the lines you described.
------
Regards,
Alexander Korotkov
Supabase
| Attachment | Content-Type | Size |
|---|---|---|
| v5-0001-Use-the-join-collation-when-unique-ifying-a-semij.patch | application/octet-stream | 9.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Guo | 2026-09-11 01:03:24 | Re: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation |
| Previous Message | PG Bug reporting form | 2026-09-10 20:32:22 | BUG #19683: Can a stale postmaster.pid affect connections after PostgreSQL has already started successfully? |