postgresql/doc/README.mb.jp
Marc G. Fournier bf00bbb0c4 I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp

Attached are patches to enhance the multi-byte support.  (patches are
against 7/18 snapshot)

* determine encoding at initdb/createdb rather than compile time

Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.

For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database.  Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.

* support for PGCLIENTENCODING when issuing COPY command

commands/copy.c modified.

* support for SQL92 syntax "SET NAMES"

See gram.y.

* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB

New directory test/mb added.

* clean up source files

Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
1998-07-24 03:32:46 +00:00

11 KiB

postgresql 6.4 multi-byte (MB) support README 1998/7/22 $B:n@.
 
$B@P0fC#IW
t-ishii@sra.co.jp
http://www.sra.co.jp/people/t-ishii/PostgreSQL/
 
$B$O$8$a$K!'
 
PostgreSQL $B$K$*$1$k%^%k%A%P%$%H%5%]!<%H$O0J2<$N$h$&$JFCD'$r;}$C$F$$$^$9!#
 
1.$B%^%k%A%P%$%HJ8;z$H$7$F!"F|K\8l!"Cf9q8l$J$I$N3F9q$N EUC$B!"Unicode$B!"
mule internal code, ISO-8859-1 $B$,%G!<%?%Y!<%9:n@.;~$KA*Br2DG=!#
$B%G!<%?%Y!<%9$K$O$3$N%3!<%I$N$^$^3JG<$5$l$^$9!#
2.$B%F!<%V%kL>$K%^%k%A%P%$%HJ8;z$,;HMQ2DG=($B$?$@$7!"OS $B$,%^%k%A%P%$%H
$B$N%U%!%$%kL>$r5v$7$F$$$k$3$H$,I,MW)
3.$B%+%i%`L>$K%^%k%A%P%$%HJ8;z$,;HMQ2DG=
4.$B%G!<%?$=$N$b$N$K$b%^%k%A%P%$%HJ8;z$,;HMQ2DG=
5.$B%^%k%A%P%$%HJ8;z$N@55,I=8=8!:w$,;HMQ2DG=
6.$B%^%k%A%P%$%HJ8;z$N LIKE $B8!:w$,;HMQ2DG=
7.character_length(), position(), substring() $B$G$N%^%k%A%P%$%H
$B%5%]!<%H
8.$B4D6-JQ?t PGCLIENTENCODING $B$K$h$j!"%/%i%$%"%s%HB&$NJ8;z%3!<%I
$B$,%P%C%/%(%s%IB&$H0[$k>l9g$K!"<+F0E*$K%3!<%IJQ49$r9T$J$$$^$9!#
 
$B%$%s%9%H!<%k!'
 
$B%G%U%)%k%H$G$O PostgreSQL $B$O%^%k%A%P%$%H$r%5%]!<%H$7$F$$$^$;$s!#
$B%^%k%A%P%$%H%5%]!<%H$rM-8z$K$9$kJ}K!$r@bL@$7$^$9!#
 
src/Makefile.custom $B$H$$$&%U%!%$%k$r:n$j!"
 
MB=EUC_JP
 
$B$N 1 $B9T$rDI2C$7$^$9!#$"$k$$$O!"configure $B5/F0;~$K0J2<$N$h$&$K;XDj$7$^$9!#
 
% configure --with-mb=EUC_JP
 
$BJ8;z%3!<%I$H$7$F$O EUC_JP $B$r4^$a!"0J2<$N%3!<%I$, initdb $B$K$h$k
$B%G!<%?%Y!<%9=i4|2=;~$*$h$S%G!<%?%Y!<%9:n@.;~
(Unix $B%3%^%s%I$N createdb $B$b$7$/$O SQL $B$N create database)
$B$K;XDj$G$-$^$9!#Makefile.custom $B$"$k$$$O configure $B$G;XDj$7$?J8;z%3!<
$B%I$O initdb $B$N>JN,;~$NJ8;z%3!<%I$K$J$j$^$9!#
 
EUC_JP $BF|K\8l EUC
EUC_CN GB $B$r%Y!<%9$K$7$?CfJ8EUC$B!#code set 2 $B$O
SS2+2$B%P%$%H%3!<%I = 3$B%P%$%HI=8=$G$9!#
EUC_KR $B4Z9q8l EUC$B!#
EUC_TW $BBfOQ$N EUC$B!#code set 2 $B$O
SS2+$BLLHV9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9%H!<%k$N>\:Y$O INSTALL $B$H$$$&
$B%F%-%9%H%U%!%$%k$r8fMw2<$5$$!#$^$?!"
http://www.sra.co.jp/people/t-ishii/PostgreSQL/ $B$G$b4JC1$J%$%s%9%H!<
$B%kJ}K!$r>R2p$7$F$$$^$9!#
 
initdb/createdb/create database $B$K$*$1$kJ8;z%3!<%I$N;XDj$K$D$$$F
 
initdb $B$G$O0J2<$N%*%W%7%g%s$GJ8;z%3!<%I$,;XDj$G$-$^$9!#
 
-e $BJ8;z%3!<%I
-pgencoding $BJ8;z%3!<%I
 
$B$3$3$G;XDj$7$?J8;z%3!<%I$O!"0J8e createdb/create database $B$GJ8;z%3!<%I$r
$B>JN,$7$?>l9g$K@_Dj$5$l$kJ8;z%3!<%I$K$J$j$^$9!#-e $B$^$?$O -pgencoding
$B%*%W%7%g%s$r>JN,$7$?>l9g$O!"Makefile.custom $B$"$k$$$O configure $B$G;X
$BDj$7$?J8;z%3!<%I$,:NMQ$5$l$^$9!#
 
createdb $B$G$O0J2<$N%*%W%7%g%s$GJ8;z%3!<%I$,;XDj$G$-$^$9!#
 
-E $BJ8;z%3!<%I
 
create database $B$G$O0J2<$N%*%W%7%g%s$GJ8;z%3!<%I$,;XDj$G$-$^$9!#
 
CREATE DATABASE dbanme WITH ENCODING = '$BJ8;z%3!<%I';
 
LOCATION $B$rF1;~$K;XDj$9$k>l9g$O0J2<$N$h$&$K$J$j$^$9!#
 
CREATE DATABASE dbanme WITH LOCATION = 'path' ENCODING = '$BJ8;z%3!<%I';
 
createdb/create database $B$O!"J8;z%3!<%I;XDj$r>JN,$7$?>l9g$O!"initdb
$B$G;XDj$7$?J8;z%3!<%I$,:NMQ$5$l$^$9!#
 
$B4D6-JQ?t PGCLIENTENCODING $B$K$D$$$F!'
 
$B4D6-JQ?t PGCLIENTENCODING $B$,@_Dj$5$l$F$$$J$$>l9g!"libpq $B$O%;%C%7%g%s
$B3+;O;~$K%5!<%PB&$KJ8;z%3!<%I$rLd$$9g$o$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reSQL $B%a!<%j%s%0%j%9%H
$B$N%a%s%P$NJ}$+$i%"%I%P%$%9$rD:$-$^$7$?!#$3$3$K46<U$7$^$9!#
$B$^$?!"SJIS $BBP1~$K$D$$$F$O!";T@n@$B$*CcBg$5$s$N%Q%C%A$r;29M$K$5$;$F$$
$B$?$@$-$^$7$?!#
 
$B2~DjMzNr!'
 
1998/7/22 6.4 $B&A8~$1$K%Q%C%A$r%j%j!<%9!#
* initdb/createdb/create database $B$G%5!<%PB&$NJ8;z%3!<%I$r@_Dj
$B$G$-$k5!G=<BAu!#$3$N$?$a!"%7%9%F%`%+%?%m%0$N pg_database $B$K
$B?7$7$$%+%i%` encoding $B$rDI2C(MB$B$,M-8z$J;~$@$1)
* copy $B$, PGCLIENTENCODING $B$KBP1~
* SQL92 $B$N "SET NAMES" $B$r%5%]!<%H(MB$B$,M-8z$J;~$@$1)
* LATIN2-5 $B$r%5%]!<%H
* regression test $B$K unicode $B$N%F%9%H%1!<%9$rDI2C
* MB $B@lMQ$N regression $B%F%9%H%G%#%l%/%H%j test/mb $B$rDI2C
* $B%=!<%9%U%!%$%k$NCV$->l=j$rBgI}8+D>$7!#MB $B4X78$O
include/mb, backend/utils/mb $B$KCV$/$h$&$K$7$?
 
1998/5/25 $B%P%0=$@5(mb_b3.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!"
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
 
1998/5/18 $B5!G=DI2C!?%P%0=$@5(mb_b2.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!"
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$kM=Dj)
* $B4D6-JQ?t PGCLIENTENCODING $B$N%5%]!<%H!#%/%i%$%"%s%HB&$N
$BJ8;z%3!<%I$r;XDj$9$k!#8=:_!"SJIS, EUC_*, MULE_INTERNAL, LATIN1
$B$,;XDj$G$-$k!#$^$?!"
set client_encoding to 'sjis';
$B$G$b2DG=
* 8bit $BJ8;z$,EO$k$HLdBj$,5/$-$k2U=j$K$G$-$k$@$1BP1~
 
1998/4/21 $B5!G=DI2C!?%P%0=$@5(mb_b1.patch $B$H$7$F pgsql-jp ML $B$K%j%j!<%9!"
$BK\2H$G$O 6.4 snapshot $B$K<h$j9~$^$l$F$$$k)
* character_length(), position(), substring() $B$N%^%k%A%P%$%H
$BBP1~
* octet_length() $BDI2C $B"* initdb $B$N$d$jD>$7I,MW
* configure $B$N%*%W%7%g%s$K MB $B%5%]!<%HDI2C
(ex. configure --with-mb=EUC_JP)
* EUC_KR $B$N regression test $BDI2C
("Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr> $B$5$sDs6!)
* EUC_JP $B$N regression test $B$K character_length(), position(),
substring(), octet_length() $BDI2C
* regress.sh $B$N SystemV $B$K$*$1$kHs8_49@-=$@5
* toupper(), tolower() $B$K 8bit $BJ8;z$,EO$k$HMn$A$k$3$H$,
$B$"$k$N$r=$@5
 
1998/3/25 PostgreSQL 6.3.1 $B%j%j!<%9!"MB PL2 $B$,<h$j9~$^$l$k
 
1998/3/10 PL2 $B$r%j%j!<%9
* EUC_JP, EUC_CN, MULE_INTERNAL $B$N regression test $B$rDI2C
(EUC_CN $B$N%G!<%?$O he@sra.co.jp $B$5$sDs6!)
* regexp $B$K$*$$$F!"isalpha $B$J$I$K unsigend char $B0J30$NCM$,
$BEO$i$J$$$h$&$K%,!<%I$r$+$1$k
* $B1Q8l$N%I%-%e%a%s%H$rDI2C
* MB $B$rDj5A$7$J$$>l9g$KH/@8$9$k%P%0$r=$@5
 
1998/3/1 PL1 $B$r%j%j!<%9
 
$B0J>e!#