Re: [HACKERS] select like...not using index
"Magnus Hagander" <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.patches |
|---|---|
| Message-ID | <[email protected]> |
>> Here is what I think happened (this might be a bug, might not): Each
>> night I run initdb but I use a special postgresql.conf which is
>> optimized for quick data loading. This is copied over the
>default one
>> after the server is started. This contains the locale
>information which
>> is 'initialized by initdb'. These were still 'C' because
>this file was
>> generated before the default locale was changed. psql shows this
>> information when you ask it for the locale info even if it is
>> incorrect.
>
>I don't believe this for a minute. lc_ctype and lc_collate can *not*
>be set from postgresql.conf. Try it.
It certainly doesn't. There still was a bug with the locale stuff,
though - the GUC variable was not set in the child processes. So "show
lc_collate" would *always* return "C", for example. attached patch fixes
this.
//Magnus
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
locale_guc.patch
(application/octet-stream, 772 B)
Index: src/backend/postmaster/postmaster.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/postmaster/postmaster.c,v
retrieving revision 1.402
diff -c -r1.402 postmaster.c
*** src/backend/postmaster/postmaster.c 3 Jun 2004 02:08:03 -0000 1.402
--- src/backend/postmaster/postmaster.c 7 Jun 2004 19:21:14 -0000
***************
*** 3320,3327 ****
--- 3320,3331 ----
read_array_var(str_buf, fp);
setlocale(LC_COLLATE, str_buf);
+ SetConfigOption("lc_collate", str_buf,
+ PGC_INTERNAL, PGC_S_OVERRIDE);
read_array_var(str_buf, fp);
setlocale(LC_CTYPE, str_buf);
+ SetConfigOption("lc_ctype", str_buf,
+ PGC_INTERNAL, PGC_S_OVERRIDE);
/* Release file */
FreeFile(fp);