Re: Reorganize collation lookup time and place - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Reorganize collation lookup time and place
Date
Msg-id 20181212175653.yaekk3gn7qui2ryv@alap3.anarazel.de
Whole thread Raw
In response to Reorganize collation lookup time and place  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Reorganize collation lookup time and place  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2018-12-10 16:12:54 +0100, Peter Eisentraut wrote:
> Attached is a patch that reorganizes how and where collations are looked up.
> 
> Until now, a fmgr C function that makes use of collation information
> (for example varstr_cmp(), str_toupper()) gets passed the collation OID,
> looks up the collation with pg_newlocale_from_collation(), and then does
> something with it.
> 
> With this change, the lookup is moved earlier, typically during executor
> initialization.  The fmgr functions receive the locale pointer that is
> the result of that lookup.
> 
> This makes the collation lookup more similar to the function lookup.  In
> many cases they now happen right next to each other.
> pg_newlocale_from_collation() becomes analogous to fmgr_info() and
> pg_locale_t to FmgrInfo *.

Why isn't this integrated into fmgr_info()?

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Can ICU be used for a database's default sort order?
Next
From: Tomas Vondra
Date:
Subject: Re: COPY FROM WHEN condition