mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +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:
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.14 1997/03/26 06:53:57 scrappy Exp $
|
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.15 1997/04/02 18:10:32 scrappy Exp $
|
||||||
#
|
#
|
||||||
# NOTES
|
# NOTES
|
||||||
# Essentially all Postgres make files include this file and use the
|
# Essentially all Postgres make files include this file and use the
|
||||||
@ -146,6 +146,11 @@ ENFORCE_ALIGNMENT= true
|
|||||||
# Comment out PROFILE to generate a profile version of the binaries
|
# Comment out PROFILE to generate a profile version of the binaries
|
||||||
#PROFILE= -p -non_shared
|
#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...
|
# If you plan to use Kerberos for authentication...
|
||||||
#
|
#
|
||||||
# Comment out KRBVERS if you do not use Kerberos.
|
# Comment out KRBVERS if you do not use Kerberos.
|
||||||
@ -716,6 +721,11 @@ ifndef CASSERT
|
|||||||
CFLAGS+= -DNO_ASSERT_CHECKING
|
CFLAGS+= -DNO_ASSERT_CHECKING
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef USE_LOCALE
|
||||||
|
CFLAGS+= -DUSE_LOCALE
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifdef PROFILE
|
ifdef PROFILE
|
||||||
CFLAGS+= $(PROFILE)
|
CFLAGS+= $(PROFILE)
|
||||||
LDFLAGS+= $(PROFILE)
|
LDFLAGS+= $(PROFILE)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for the bootstrap module
|
# Makefile for the bootstrap module
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.4 1996/11/14 07:33:20 bryanh Exp $
|
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.5 1997/04/02 18:10:46 scrappy Exp $
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
|
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
|
||||||
@ -27,13 +27,6 @@ INCLUDE_OPT= -I.. \
|
|||||||
|
|
||||||
CFLAGS+= $(INCLUDE_OPT)
|
CFLAGS+= $(INCLUDE_OPT)
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
|
||||||
# Until we figure out how to get rid of the warnings in this directory,
|
|
||||||
# we must turn off any -Werror that is in CFLAGS now. These options only
|
|
||||||
# exist for the gcc compiler.
|
|
||||||
CFLAGS+= -Wno-error
|
|
||||||
endif
|
|
||||||
|
|
||||||
BOOTYACCS= bootstrap_tokens.h bootparse.c
|
BOOTYACCS= bootstrap_tokens.h bootparse.c
|
||||||
|
|
||||||
OBJS= bootparse.o bootscanner.o bootstrap.o
|
OBJS= bootparse.o bootscanner.o bootstrap.o
|
||||||
|
@ -7,13 +7,16 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
#include <locale.h>
|
||||||
|
#endif
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "bootstrap/bootstrap.h" /* for BootstrapMain() */
|
#include "bootstrap/bootstrap.h" /* for BootstrapMain() */
|
||||||
@ -31,6 +34,10 @@ int
|
|||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
setlocale(LC_CTYPE,""); /* take locale information from an environment */
|
||||||
|
setlocale(LC_COLLATE,"");
|
||||||
|
#endif
|
||||||
#if defined(NOFIXADE) || defined(NOPRINTADE)
|
#if defined(NOFIXADE) || defined(NOPRINTADE)
|
||||||
/*
|
/*
|
||||||
* Must be first so that the bootstrap code calls it, too.
|
* Must be first so that the bootstrap code calls it, too.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 1994, Regents of the University of California
|
# Copyright (c) 1994, Regents of the University of California
|
||||||
#
|
#
|
||||||
# $Id: Makefile,v 1.3 1997/03/14 16:02:40 scrappy Exp $
|
# $Id: Makefile,v 1.4 1997/04/02 18:11:49 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ INCLUDE_OPT = -I../.. \
|
|||||||
-I../../port/$(PORTNAME) \
|
-I../../port/$(PORTNAME) \
|
||||||
-I../../../include
|
-I../../../include
|
||||||
|
|
||||||
CFLAGS+=$(INCLUDE_OPT) -Wno-error
|
CFLAGS+=$(INCLUDE_OPT)
|
||||||
|
|
||||||
OBJS = geqo_copy.o geqo_eval.o geqo_main.o geqo_misc.o \
|
OBJS = geqo_copy.o geqo_eval.o geqo_main.o geqo_misc.o \
|
||||||
geqo_params.o geqo_paths.o geqo_pool.o geqo_recombination.o \
|
geqo_params.o geqo_paths.o geqo_pool.o geqo_recombination.o \
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for parser
|
# Makefile for parser
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.4 1996/11/14 07:33:30 bryanh Exp $
|
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.5 1997/04/02 18:12:14 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -17,13 +17,6 @@ INCLUDE_OPT= -I.. \
|
|||||||
|
|
||||||
CFLAGS+= $(INCLUDE_OPT)
|
CFLAGS+= $(INCLUDE_OPT)
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
|
||||||
# Until we figure out how to get rid of the warnings in this directory,
|
|
||||||
# we must turn off any -Werror that is in CFLAGS now. These options only
|
|
||||||
# exist for the gcc compiler.
|
|
||||||
CFLAGS+= -Wno-error
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS= analyze.o catalog_utils.o dbcommands.o gram.o \
|
OBJS= analyze.o catalog_utils.o dbcommands.o gram.o \
|
||||||
keywords.o parser.o parse_query.o scan.o scansup.o sysfunc.o
|
keywords.o parser.o parse_query.o scan.o scansup.o sysfunc.o
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for postmaster
|
# Makefile for postmaster
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.4 1996/12/28 02:12:04 momjian Exp $
|
# $Header: /cvsroot/pgsql/src/backend/postmaster/Makefile,v 1.5 1997/04/02 18:12:39 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -17,17 +17,6 @@ INCLUDE_OPT = -I.. \
|
|||||||
|
|
||||||
CFLAGS+=$(INCLUDE_OPT)
|
CFLAGS+=$(INCLUDE_OPT)
|
||||||
|
|
||||||
ifeq ($(PORTNAME), sparc_solaris)
|
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
|
||||||
# Until we figure out how to get rid of the warnings in this directory,
|
|
||||||
# we must turn off any -Werror that is in CFLAGS now. These options only
|
|
||||||
# exist for the gcc compiler.
|
|
||||||
CFLAGS+= -Wno-error
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS = postmaster.o
|
OBJS = postmaster.o
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Makefile for tcop
|
# Makefile for tcop
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.9 1997/03/25 02:35:22 scrappy Exp $
|
# $Header: /cvsroot/pgsql/src/backend/tcop/Makefile,v 1.10 1997/04/02 18:13:01 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -17,13 +17,6 @@ INCLUDE_OPT= -I.. \
|
|||||||
|
|
||||||
CFLAGS+= $(INCLUDE_OPT)
|
CFLAGS+= $(INCLUDE_OPT)
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
|
||||||
# Until we figure out how to get rid of the warnings in this directory,
|
|
||||||
# we must turn off any -Werror that is in CFLAGS now. These options only
|
|
||||||
# exist for the gcc compiler.
|
|
||||||
CFLAGS+= -Wno-error
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS= aclchk.o dest.o fastpath.o postgres.o pquery.o utility.o variable.o
|
OBJS= aclchk.o dest.o fastpath.o postgres.o pquery.o utility.o variable.o
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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--;
|
len--;
|
||||||
}
|
}
|
||||||
if (len)
|
if (len)
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
return (bool) (strcoll(a2p,a1p));
|
||||||
|
#else
|
||||||
return (bool) (*a1p < *a2p);
|
return (bool) (*a1p < *a2p);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
return (bool) (arg1->vl_len < arg2->vl_len);
|
return (bool) (arg1->vl_len < arg2->vl_len);
|
||||||
}
|
}
|
||||||
@ -342,7 +346,11 @@ text_le(struct varlena *arg1, struct varlena *arg2)
|
|||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
if (len)
|
if (len)
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
return (bool) (strcoll(a2p,a1p));
|
||||||
|
#else
|
||||||
return (bool) (*a1p < *a2p);
|
return (bool) (*a1p < *a2p);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
return ((bool) VARSIZE(arg1) <= VARSIZE(arg2));
|
return ((bool) VARSIZE(arg1) <= VARSIZE(arg2));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.11 1997/03/25 09:19:41 scrappy Exp $
|
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.12 1997/04/02 18:13:47 scrappy Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -25,11 +25,6 @@ ifdef KRBVERS
|
|||||||
CFLAGS+= $(KRBFLAGS)
|
CFLAGS+= $(KRBFLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CC), gcc)
|
|
||||||
CFLAGS+= -Wno-error
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
shlib :=
|
shlib :=
|
||||||
install-shlib-dep :=
|
install-shlib-dep :=
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user