Re: Reorganize collation lookup time and place

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reorganize collation lookup time and place
Date: 2018-12-12 17:56:53
Message-ID: 20181212175653.yaekk3gn7qui2ryv@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2018-12-12 18:28:29 Re: COPY FROM WHEN condition
Previous Message Peter Eisentraut 2018-12-12 17:53:44 Re: [HACKERS] Can ICU be used for a database's default sort order?