1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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'
This commit is contained in:
Marc G. Fournier
1997-04-02 18:13:47 +00:00
parent a10a951a46
commit 5b1311acfb
9 changed files with 35 additions and 47 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.11 1997/03/14 23:21:12 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.12 1997/04/02 18:13:24 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -311,7 +311,11 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
len--;
}
if (len)
#ifdef USE_LOCALE
return (bool) (strcoll(a2p,a1p));
#else
return (bool) (*a1p < *a2p);
#endif
else
return (bool) (arg1->vl_len < arg2->vl_len);
}
@ -342,7 +346,11 @@ text_le(struct varlena *arg1, struct varlena *arg2)
len--;
}
if (len)
#ifdef USE_LOCALE
return (bool) (strcoll(a2p,a1p));
#else
return (bool) (*a1p < *a2p);
#endif
else
return ((bool) VARSIZE(arg1) <= VARSIZE(arg2));
}