Re: should check collations when creating partitioned index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: should check collations when creating partitioned index
Date: 2023-11-20 16:25:33
Message-ID: 1327559.1700497533@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> On 14.11.23 17:15, Tom Lane wrote:
>> I don't love the patch details though. It seems entirely wrong to check
>> this before we check the opclass match.

> Not sure why? The order doesn't seem to matter?

The case that was bothering me was if we had a non-collated type
versus a collated type. That would result in throwing an error
about collation mismatch, when complaining about the opclass seems
more apropos. However, if we do this:

> I see. That means we shouldn't raise an error on a mismatch but just do
> if (key->partcollation[i] != collationIds[j])
> continue;

it might not matter much.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-11-20 16:40:43 Re: On non-Windows, hard depend on uselocale(3)
Previous Message Robert Haas 2023-11-20 16:24:25 Re: Use of backup_label not noted in log