1 postgresql 6.4 multi-byte (MB) support README Jul 22 1998
5 http://www.sra.co.jp/people/t-ishii/PostgreSQL/
9 The MB support is intended for allowing PostgreSQL to handle
10 multi-byte character sets such as EUC(Extended Unix Code), Unicode and
11 Mule internal code. With the MB enabled you can use multi-byte
12 character sets in regexp ,LIKE and some functions. The encoding system
13 chosen is determined when initializing your PostgreSQL installation
14 using initdb(1). Note that this can be overrided when creating a
15 database using createdb(1) or create database SQL command. So you
16 could have multiple databases with different encoding system.
18 MB also fixes some problems concerning with 8-bit single byte
19 character sets including ISO8859. (I would not say all of problems
20 have been fixed. I just confirmed that the regression test ran fine
21 and a few French characters could be used with the patch. Please let
22 me know if you find any problem while using 8-bit characters)
26 create src/Makefile.custom with a line including:
30 or run configure with the mb option:
32 % configure --with-mb=encoding_system
34 where encoding_system is one of:
40 UNICODE Unicode(UTF-8)
41 MULE_INTERNAL Mule internal
42 LATIN1 ISO 8859-1 English and some European languages
43 LATIN2 ISO 8859-2 English and some European languages
44 LATIN3 ISO 8859-3 English and some European languages
45 LATIN4 ISO 8859-4 English and some European languages
46 LATIN5 ISO 8859-5 English and some European languages
55 % configure --with-mb=EUC_JP
57 If MB is disabled, nothing is changed except better supporting for
58 8-bit single byte character sets.
60 2. How to set encoding
62 initdb command defines the default encoding for a PostgreSQL
63 installation. For example:
67 sets the default encoding to EUC_JP(Extended Unix Code for Japanese).
68 Note that you can use "-pgencoding" instead of "-e" if you like longer
69 option string:-) If no -e or -pgencoding option is given, the encoding
70 specified at the compile time is used.
72 You can create a database with a different encoding.
74 % createdb -E EUC_KR korean
76 will create a database named "korean" with EUC_KR encoding. The
77 another way to accomplish this is to use a SQL command:
79 CREATE DATABASE korean WITH ENCODING = 'EUC_KR';
83 If an environment variable PGCLIENTENCODING is defined on the
84 frontend, automatic encoding translation is done by the backend. For
85 example, if the backend has been compiled with MB=EUC_JP and
86 PGCLIENTENCODING=SJIS(Shift JIS: yet another Japanese encoding
87 system), then any SJIS strings coming from the frontend would be
88 translated to EUC_JP before going into the parser. Outputs from the
89 backend would be translated to SJIS of course.
91 Supported encodings for PGCLIENTENCODING are:
94 SJIS Yet another Japanese encoding
98 MULE_INTERNAL Mule internal
99 LATIN1 ISO 8859-1 English and some European languages
100 LATIN2 ISO 8859-2 English and some European languages
101 LATIN3 ISO 8859-3 English and some European languages
102 LATIN4 ISO 8859-4 English and some European languages
103 LATIN5 ISO 8859-5 English and some European languages
105 Note that UNICODE is not supported(yet). Also note that the
106 translation is not always possible. Suppose you choose EUC_JP for the
107 backend, LATIN1 for the frotend, then some Japanese characters cannot
108 be translated into latin. In this case, a letter cannot be represented
109 in the Latin character set, would be transformed as:
113 3. SET CLIENT_ENCODING TO command
115 Actually setting the frontend side encoding information is done by a
118 SET CLIENT_ENCODING TO 'encoding';
120 where encoding is one of the encodings those can be set to
121 PGCLIENTENCODING. Also you can use SQL92 syntax "SET NAMES" for this
124 SET NAMES 'encoding';
126 To query the current the frontend encoding:
128 SHOW CLIENT_ENCODING;
130 To return to the default encoding:
132 RESET CLIENT_ENCODING;
134 This would reset the frontend encoding to same as the backend
135 encoding, thus no endoing translation would be performed.
139 These are good sources to start learning various kind of encoding
142 ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/cjk.inf
143 Detailed explanations of EUC_JP, EUC_CN, EUC_KR, EUC_TW
144 appear in section 3.2.
146 Unicode: http://www.unicode.org/
147 The homepage of UNICODE.
150 UTF-8 is defined here.
155 * determine encoding at initdb/createdb rather than compile time
156 * support for PGCLIENTENCODING when issuing COPY command
157 * support for SQL92 syntax "SET NAMES"
158 * support for LATIN2-5
159 * add UNICODE regression test case
160 * new test suite for MB
161 * clean up source files
164 * add support for the encoding translation between the backend
166 * new command SET CLIENT_ENCODING etc. added
167 * add support for LATIN1 character set
168 * enhance 8 bit cleaness
170 April 21, 1998 some enhancements/fixes
171 * character_length(), position(), substring() are now aware of
172 multi-byte characters
174 * add --with-mb option to configure
175 * new regression tests for EUC_KR
176 (contributed by "Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr>)
177 * add some test cases to the EUC_JP regression test
178 * fix problem in regress/regress.sh in case of System V
179 * fix toupper(), tolower() to handle 8bit chars
181 Mar 25, 1998 MB PL2 is incorporated into PostgreSQL 6.3.1
183 Mar 10, 1998 PL2 released
184 * add regression test for EUC_JP, EUC_CN and MULE_INTERNAL
185 * add an English document (this file)
186 * fix problems concerning 8-bit single byte characters
188 Mar 1, 1998 PL1 released