postgresql/src/test/regress/sql/mule_internal.sql
Bruce Momjian cb7cbc16fa Hi, here are the patches to enhance existing MB handling. This time
I have implemented a framework of encoding translation between the
backend and the frontend. Also I have added a new variable setting
command:

SET CLIENT_ENCODING TO 'encoding';

Other features include:
	Latin1 support more 8 bit cleaness

See doc/README.mb for more details. Note that the pacthes are
against May 30 snapshot.

Tatsuo Ishii
1998-06-16 07:29:54 +00:00

73 lines
4.0 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 ÍѸì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
select *,character_length(ÍѸì) from ·×»»µ¡ÍѸì;
select *,octet_length(ÍѸì) from ·×»»µ¡ÍѸì;
select *,position('’¥Ç' in ÍѸì) from ·×»»µ¡ÍѸì;
select *,substring(ÍѸì from 10 for 4) from ·×»»µ¡ÍѸì;
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 ÊõÓï ~* '‘µç‘ÄÔ[‘Ïԑͼ]';
select *,character_length(ÊõÓï) from ¼ÆËã»úÊõÓï;
select *,octet_length(ÊõÓï) from ¼ÆËã»úÊõÓï;
select *,position('‘ÏÔ' in ÊõÓï) from ¼ÆËã»úÊõÓï;
select *,substring(ÊõÓï from 3 for 4) from ¼ÆËã»úÊõÓï;
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 ¿ë¾î ~* '“ÄÄ“Ç»“ÅÍ[“µð“±×]';
select *,character_length(¿ë¾î) from ͪߩѦ¿ë¾î;
select *,octet_length(¿ë¾î) from ͪߩѦ¿ë¾î;
select *,position('“µð' in ¿ë¾î) from ͪߩѦ¿ë¾î;
select *,substring(¿ë¾î from 3 for 4) from ͪߩѦ¿ë¾î;
drop table test;
create table test (t text);
insert into test values('ENGLISH');
insert into test values('FRAN<EFBFBD>ÇAIS');
insert into test values('ESPA<EFBFBD>ÑOL');
insert into test values('<EFBFBD>ÍSLENSKA');
insert into test values('ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA');
vacuum test;
select * from test;
select * from test where t = 'ESPA<EFBFBD>ÑOL';
select * from test where t ~* 'espa<EFBFBD>Ñol';
select *,character_length(t) from test;
select *,octet_length(t) from test;
select *,position('L' in t) from test;
select *,substring(t from 3 for 4) from test;