diff options
| author | Marc G. Fournier <scrappy@hub.org> | 1997-04-02 18:13:47 +0000 |
|---|---|---|
| committer | Marc G. Fournier <scrappy@hub.org> | 1997-04-02 18:13:47 +0000 |
| commit | 5b1311acfbd6b84dbb84975240914214c51fcb48 (patch) | |
| tree | 3c40b80cc95a8fcb51186f87cf5171620e74f065 /src/backend/main | |
| parent | a10a951a4651fed4a352008e43e616d0b16a0515 (diff) | |
| download | postgresql-5b1311acfbd6b84dbb84975240914214c51fcb48.tar.gz | |
From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !
Hi there,
here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:
#!/bin/sh
export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
Diffstat (limited to 'src/backend/main')
| -rw-r--r-- | src/backend/main/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c index aa8d9836d5..2fa7a46242 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -7,13 +7,16 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.3 1996/11/14 20:49:09 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.4 1997/04/02 18:11:08 scrappy Exp $ * *------------------------------------------------------------------------- */ #include <stdio.h> #include <string.h> #include <unistd.h> +#ifdef USE_LOCALE + #include <locale.h> +#endif #include "postgres.h" #include "miscadmin.h" #include "bootstrap/bootstrap.h" /* for BootstrapMain() */ @@ -31,6 +34,10 @@ int main(int argc, char *argv[]) { int len; +#ifdef USE_LOCALE + setlocale(LC_CTYPE,""); /* take locale information from an environment */ + setlocale(LC_COLLATE,""); +#endif #if defined(NOFIXADE) || defined(NOPRINTADE) /* * Must be first so that the bootstrap code calls it, too. |
