--- src/Makefile.global.in.ORG Wed Mar 26 14:00:26 1997 +++ src/Makefile.global.in Thu Apr 3 18:10:32 1997 @@ -147,4 +147,9 @@ #PROFILE= -p -non_shared +# 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 + # If you plan to use Kerberos for authentication... # @@ -716,4 +721,9 @@ CFLAGS+= -DNO_ASSERT_CHECKING endif + +ifdef USE_LOCALE + CFLAGS+= -DUSE_LOCALE +endif + ifdef PROFILE --- src/backend/main/main.c.ORG Fri Nov 15 02:00:31 1996 +++ src/backend/main/main.c Thu Apr 3 18:00:38 1997 @@ -15,4 +15,7 @@ #include #include +#ifdef USE_LOCALE + #include +#endif #include "postgres.h" #include "miscadmin.h" @@ -32,4 +35,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 Sat Mar 15 08:01:46 1997 +++ src/backend/utils/adt/varlena.c Thu Apr 3 17:59:49 1997 @@ -312,5 +312,9 @@ } 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); @@ -343,5 +347,9 @@ } if (len) +#ifdef USE_LOCALE + return (bool) (strcoll(a2p,a1p)); +#else return (bool) (*a1p < *a2p); +#endif else return ((bool) VARSIZE(arg1) <= VARSIZE(arg2));