From: t-ishii@sra.co.jp
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:
parent
661ecf3c48
commit
609026bb6b
55
src/test/regress/expected/euc_cn.out
Normal file
55
src/test/regress/expected/euc_cn.out
Normal 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)
|
||||
|
55
src/test/regress/expected/euc_jp.out
Normal file
55
src/test/regress/expected/euc_jp.out
Normal 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)
|
||||
|
85
src/test/regress/expected/mule_internal.out
Normal file
85
src/test/regress/expected/mule_internal.out
Normal 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)
|
||||
|
15
src/test/regress/sql/euc_cn.sql
Normal file
15
src/test/regress/sql/euc_cn.sql
Normal 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 术语 ~* '电脑[显图]';
|
15
src/test/regress/sql/euc_jp.sql
Normal file
15
src/test/regress/sql/euc_jp.sql
Normal 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 用語 ~* 'コンピュータ[デグ]';
|
21
src/test/regress/sql/mule_internal.sql
Normal file
21
src/test/regress/sql/mule_internal.sql
Normal 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 ’ÍÑ’¸ì ~* '‘µç‘ÄÔ[‘Ïԑͼ]';
|
Loading…
x
Reference in New Issue
Block a user