Re: tiny step toward threading: reduce dependence on setlocale() - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id 468dd1fb-20f5-4213-bc70-d1388ccf28fa@proxel.se
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List pgsql-hackers
Nice refactoring!

Two small comments about CheckMyDatabase().

- Shouldn't we look at the default_locale.ctype_is_c when setting 
database_ctype_is_c instead of doing a strcmp()? or maybe we should even 
remove the global variable and always look at the default_locale?

- I think that the lookup of Anum_pg_database_datlocale could be done 
later in the code since it is not needed when we use a libc locale. E.g. 
as below.

     if (dbform->datlocprovider == COLLPROVIDER_LIBC)
         locale = collate;
     else
     {
         datum = SysCacheGetAttr(DATABASEOID, tup, 
Anum_pg_database_datlocale, &isnull);
         if (!isnull)
         locale = TextDatumGetCString(datum);
     }

Also is there any reaosn you do not squash th 4th and the 6th patch?

Andreas



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Add ALL_CANDIDATES option to EXPLAIN
Next
From: Tom Lane
Date:
Subject: Re: Add ALL_CANDIDATES option to EXPLAIN