Included are patches intended for allowing PostgreSQL to handle
multi-byte charachter sets such as EUC(Extende Unix Code), Unicode and
Mule internal code. With the MB patch you can use multi-byte character
sets in regexp and LIKE. The encoding system chosen is determined at
the compile time.

To enable the MB extension, you need to define a variable "MB" in
Makefile.global or in Makefile.custom. For further information please
take a look at README.mb under doc directory.

(Note that unlike "jp patch" I do not use modified GNU regexp any
more. I changed Henry Spencer's regexp coming with PostgreSQL.)
This commit is contained in:
Marc G. Fournier 1998-03-15 07:53:03 +00:00
parent 661ecf3c48
commit 609026bb6b
6 changed files with 246 additions and 0 deletions

View File

@ -0,0 +1,55 @@
QUERY: drop table 计算机术语;
ERROR: Relation 计算机术语 Does Not Exist!
QUERY: create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16));
QUERY: create index 计算机术语index1 on 计算机术语 using btree(术语);
QUERY: create index 计算机术语index2 on 计算机术语 using btree(分类号);
QUERY: insert into 计算机术语 values('电脑显示屏','机A01上');
QUERY: insert into 计算机术语 values('电脑图形','分B01中');
QUERY: insert into 计算机术语 values('电脑程序员','人Z01下');
QUERY: vacuum 计算机术语;
QUERY: select * from 计算机术语;
术语 |分类号 |备注1a
----------+-------+------
电脑显示屏|机A01上|
电脑图形 |分B01中|
电脑程序员|人Z01下|
(3 rows)
QUERY: select * from 计算机术语 where 分类号 = '人Z01下';
术语 |分类号 |备注1a
----------+-------+------
电脑程序员|人Z01下|
(1 row)
QUERY: select * from 计算机术语 where 分类号 ~* '人z01下';
术语 |分类号 |备注1a
----------+-------+------
电脑程序员|人Z01下|
(1 row)
QUERY: select * from 计算机术语 where 分类号 like '_Z01_';
术语 |分类号 |备注1a
----------+-------+------
电脑程序员|人Z01下|
(1 row)
QUERY: select * from 计算机术语 where 分类号 like '_Z%';
术语 |分类号 |备注1a
----------+-------+------
电脑程序员|人Z01下|
(1 row)
QUERY: select * from 计算机术语 where 术语 ~ '电脑[显图]';
术语 |分类号 |备注1a
----------+-------+------
电脑显示屏|机A01上|
电脑图形 |分B01中|
(2 rows)
QUERY: select * from 计算机术语 where 术语 ~* '电脑[显图]';
术语 |分类号 |备注1a
----------+-------+------
电脑显示屏|机A01上|
电脑图形 |分B01中|
(2 rows)

View File

@ -0,0 +1,55 @@
QUERY: drop table 計算機用語;
ERROR: Relation 計算機用語 Does Not Exist!
QUERY: create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
QUERY: create index 計算機用語index1 on 計算機用語 using btree (用語);
QUERY: create index 計算機用語index2 on 計算機用語 using hash (分類コード);
QUERY: insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
QUERY: insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
QUERY: insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
QUERY: vacuum 計算機用語;
QUERY: select * from 計算機用語;
用語 |分類コード|備考1aだよ
--------------------------+----------+----------
コンピュータディスプレイ |機A01上 |
コンピュータグラフィックス|分B10中 |
コンピュータプログラマー |人Z01下 |
(3 rows)
QUERY: select * from 計算機用語 where 分類コード = '人Z01下';
用語 |分類コード|備考1aだよ
------------------------+----------+----------
コンピュータプログラマー|人Z01下 |
(1 row)
QUERY: select * from 計算機用語 where 分類コード ~* '人z01下';
用語 |分類コード|備考1aだよ
------------------------+----------+----------
コンピュータプログラマー|人Z01下 |
(1 row)
QUERY: select * from 計算機用語 where 分類コード like '_Z01_';
用語 |分類コード|備考1aだよ
------------------------+----------+----------
コンピュータプログラマー|人Z01下 |
(1 row)
QUERY: select * from 計算機用語 where 分類コード like '_Z%';
用語 |分類コード|備考1aだよ
------------------------+----------+----------
コンピュータプログラマー|人Z01下 |
(1 row)
QUERY: select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
用語 |分類コード|備考1aだよ
--------------------------+----------+----------
コンピュータディスプレイ |機A01上 |
コンピュータグラフィックス|分B10中 |
(2 rows)
QUERY: select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
用語 |分類コード|備考1aだよ
--------------------------+----------+----------
コンピュータディスプレイ |機A01上 |
コンピュータグラフィックス|分B10中 |
(2 rows)

View File

@ -0,0 +1,85 @@
QUERY: drop table ’·×’»»’µ¡’ÍÑ’¸ì;
ERROR: Relation ’·×’»»’µ¡’ÍÑ’¸ì Does Not Exist!
QUERY: create table ’·×’»»’µ¡’ÍÑ’¸ì (’ÍÑ’¸ì text, ’ʬ’Îà’¥³’¡¼’¥É varchar, È÷¹Í1A¤À¤è char(16));
QUERY: create index ·×»»µ¡ÍѸìindex1 on ’·×’»»’µ¡’ÍÑ’¸ì using btree (’ÍÑ’¸ì);
QUERY: create index ·×»»µ¡ÍѸìindex2 on ’·×’»»’µ¡’ÍÑ’¸ì using hash (’ʬ’Îà’¥³’¡¼’¥É);
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤','µ¡A01¾å');
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹','ʬB10Ãæ');
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼','¿ÍZ01²¼');
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ','»úA01ÉÏ');
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘Äԑͼ‘ÐÎ','·ÖB01ÖÐ');
QUERY: insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘ÄÔ‘³Ì‘Ðò‘Ô±','ÈËZ01ÏÂ');
QUERY: vacuum ’·×’»»’µ¡’ÍÑ’¸ì;
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì;
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
---------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ |µ¡A01¾å |
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹|ʬB10Ãæ |
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ |¿ÍZ01²¼ |
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ |»úA01ÉÏ |
‘µç‘Äԑͼ‘ÐÎ |·ÖB01ÖÐ |
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± |ÈËZ01Ï |
(6 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É = '¿ÍZ01²¼';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼|¿ÍZ01²¼ |
(1 row)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~ 'Z01';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼|¿ÍZ01²¼ |
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± |ÈËZ01Ï |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~* 'z01';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼|¿ÍZ01²¼ |
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± |ÈËZ01Ï |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z01_';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼|¿ÍZ01²¼ |
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± |ÈËZ01Ï |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z%';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼|¿ÍZ01²¼ |
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± |ÈËZ01Ï |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
---------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ |µ¡A01¾å |
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹|ʬB10Ãæ |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
---------------------------------------+---------------+--------------
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ |µ¡A01¾å |
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹|ʬB10Ãæ |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '‘µç‘ÄÔ[‘Ïԑͼ]';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
---------------+---------------+--------------
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ|»úA01ÉÏ |
‘µç‘Äԑͼ‘ÐÎ |·ÖB01ÖÐ |
(2 rows)
QUERY: select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '‘µç‘ÄÔ[‘Ïԑͼ]';
’ÍÑ’¸ì |’ʬ’Îà’¥³’¡¼’¥É|È÷¹Í1a¤À¤è
---------------+---------------+--------------
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ|»úA01ÉÏ |
‘µç‘Äԑͼ‘ÐÎ |·ÖB01ÖÐ |
(2 rows)

View File

@ -0,0 +1,15 @@
drop table ;
create table ( text, varchar, 1A char(16));
create index index1 on using btree();
create index index2 on using btree();
insert into values('电脑显示屏','机A01上');
insert into values('电脑图形','分B01中');
insert into values('电脑程序员','人Z01下');
vacuum ;
select * from ;
select * from where = '人Z01下';
select * from where ~* '人z01下';
select * from where like '_Z01_';
select * from where like '_Z%';
select * from where ~ '电脑[显图]';
select * from where ~* '电脑[显图]';

View File

@ -0,0 +1,15 @@
drop table ;
create table ( text, varchar, 1Aだよ char(16));
create index index1 on using btree ();
create index index2 on using hash ();
insert into values('コンピュータディスプレイ','機A01上');
insert into values('コンピュータグラフィックス','分B10中');
insert into values('コンピュータプログラマー','人Z01下');
vacuum ;
select * from ;
select * from where = '人Z01下';
select * from where ~* '人z01下';
select * from where like '_Z01_';
select * from where like '_Z%';
select * from where ~ 'コンピュータ[デグ]';
select * from where ~* 'コンピュータ[デグ]';

View File

@ -0,0 +1,21 @@
drop table ·×»»µ¡ÍѸì;
create table ·×»»µ¡ÍѸì (ÍѸì text, ʬÎॳ¡¼¥É varchar, È÷¹Í1A¤À¤è char(16));
create index ·×»»µ¡ÍѸìindex1 on ·×»»µ¡ÍѸì using btree (ÍѸì);
create index ·×»»µ¡ÍѸìindex2 on ·×»»µ¡ÍѸì using hash (ʬÎॳ¡¼¥É);
insert into ·×»»µ¡ÍѸì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤','µ¡A01¾å');
insert into ·×»»µ¡ÍѸì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹','ʬB10Ãæ');
insert into ·×»»µ¡ÍѸì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼','¿ÍZ01²¼');
insert into ·×»»µ¡ÍѸì values('‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ','»úA01ÉÏ');
insert into ·×»»µ¡ÍѸì values('‘µç‘Äԑͼ‘ÐÎ','·ÖB01ÖÐ');
insert into ·×»»µ¡ÍѸì values('‘µç‘ÄÔ‘³Ì‘Ðò‘Ô±','ÈËZ01ÏÂ');
vacuum ·×»»µ¡ÍѸì;
select * from ·×»»µ¡ÍѸì;
select * from ·×»»µ¡ÍѸì where ʬÎॳ¡¼¥É = '¿ÍZ01²¼';
select * from ·×»»µ¡ÍѸì where ʬÎॳ¡¼¥É ~ 'Z01';
select * from ·×»»µ¡ÍѸì where ʬÎॳ¡¼¥É ~* 'z01';
select * from ·×»»µ¡ÍѸì where ʬÎॳ¡¼¥É like '_Z01_';
select * from ·×»»µ¡ÍѸì where ʬÎॳ¡¼¥É like '_Z%';
select * from ·×»»µ¡ÍѸì where ÍѸì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
select * from ·×»»µ¡ÍѸì where ÍѸì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
select * from ·×»»µ¡ÍѸì where ÍѸì ~ '‘µç‘ÄÔ[‘Ïԑͼ]';
select * from ·×»»µ¡ÍѸì where ÍѸì ~* '‘µç‘ÄÔ[‘Ïԑͼ]';