--- src/customize.ORG Thu Jan 30 08:00:17 1997 +++ src/customize Wed Apr 2 19:27:44 1997 @@ -274,2 +274,11 @@ echo >>Makefile.custom "CASSERT= " fi + +echo " " +echo "You may choose to use locale stuff to get Postgres works +echo "with national alphabet. ~* and will work according +echo "system environment (\$LC_CTYPE and \$LC_COLLATE)" +bool "Use Locale stuff" "n" +if [ "$ans" = "y" ] ; then + echo >>Makefile.custom "USE_LOCALE = $ans " +fi --- src/Makefile.global.ORG Tue Jan 28 20:00:13 1997 +++ src/Makefile.global Wed Apr 2 19:11:16 1997 @@ -140,4 +140,10 @@ CASSERT= true +# Define USE_LOCALE to get Postgres work (sort, search) +# with national alphabet. Remember to define environment variables +# $LC_COLLATE and $LC_CTYPE before starting postmaster ! +#USE_LOCALE = 1 + + # Comment out ENFORCE_ALIGNMENT if you do NOT want unaligned access to # multi-byte types to generate a bus error. @@ -806,4 +812,8 @@ ifndef CASSERT CFLAGS+= -DNO_ASSERT_CHECKING +endif + +ifdef USE_LOCALE + CFLAGS+= -DUSE_LOCALE endif --- src/backend/main/main.c.ORG Fri Nov 15 02:00:31 1996 +++ src/backend/main/main.c Wed Apr 2 19:22:23 1997 @@ -15,4 +15,8 @@ #include #include +#ifdef USE_LOCALE + #include +#endif + #include "postgres.h" #include "miscadmin.h" @@ -32,4 +36,8 @@ { int len; +#ifdef USE_LOCALE + setlocale(LC_CTYPE,""); /* take locale information from an environment */ + setlocale(LC_COLLATE,""); +#endif #if defined(NOFIXADE) || defined(NOPRINTADE) /* --- src/backend/utils/adt/varlena.c.ORG Thu Jan 16 08:00:49 1997 +++ src/backend/utils/adt/varlena.c Wed Apr 2 19:24:36 1997 @@ -312,5 +312,9 @@ } if (len) +#ifdef USE_LOCALE + return (int32) (strcoll(a2p,a1p)); +#else return (int32) (*a1p < *a2p); +#endif else return (int32) (arg1->vl_len < arg2->vl_len); @@ -343,5 +347,9 @@ } if (len) +#ifdef USE_LOCALE + return (int32) (strcoll(a2p,a1p)); +#else return (int32) (*a1p < *a2p); +#endif else return ((int32) VARSIZE(arg1) <= VARSIZE(arg2));