Commit 0e1043b7 authored by Tatsuo Ishii's avatar Tatsuo Ishii

Fixes for char_length() change.

parent 805e0c45
...@@ -54,8 +54,8 @@ select * from ...@@ -54,8 +54,8 @@ select * from
(2 rows) (2 rows)
select *,character_length(术语) from 计算机术语; select *,character_length(术语) from 计算机术语;
术语 | 分类号 | 备注1a | length 术语 | 分类号 | 备注1a | char_length
------------+---------+--------+-------- ------------+---------+--------+-------------
电脑显示屏 | 机A01上 | | 5 电脑显示屏 | 机A01上 | | 5
电脑图形 | 分B01中 | | 4 电脑图形 | 分B01中 | | 4
电脑程序员 | 人Z01下 | | 5 电脑程序员 | 人Z01下 | | 5
......
...@@ -54,8 +54,8 @@ select * from 計算機 ...@@ -54,8 +54,8 @@ select * from 計算機
(2 rows) (2 rows)
select *,character_length(용어) from 計算機용어; select *,character_length(용어) from 計算機용어;
용어 | 分類코드 | 비고1a라구 | length 용어 | 分類코드 | 비고1a라구 | char_length
------------------+----------+------------+-------- ------------------+----------+------------+-------------
컴퓨터디스플레이 | 機A01上 | | 8 컴퓨터디스플레이 | 機A01上 | | 8
컴퓨터그래픽스 | 分B10中 | | 7 컴퓨터그래픽스 | 分B10中 | | 7
컴퓨터프로그래머 | 人Z01下 | | 8 컴퓨터프로그래머 | 人Z01下 | | 8
......
...@@ -52,8 +52,8 @@ select * from ...@@ -52,8 +52,8 @@ select * from
(1 row) (1 row)
select *, character_length(如淦杀) from 燹俑骜砧; select *, character_length(如淦杀) from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 | length 如淦杀 | 狞瞥婉螭 | 氢蛇 | char_length
--------+------------------+---------+-------- --------+------------------+---------+-------------
缳妾淦 | 绠绠绎世 | 啤A01念 | 3 缳妾淦 | 绠绠绎世 | 啤A01念 | 3
犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3 犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3
......
QUERY: drop table גђ; drop table גђ;
ERROR: Relation 'גђ' does not exist ERROR: Relation 'גђ' does not exist
QUERY: create table גђ (ђ text, ʬ varchar, 1A char(16)); create table גђ (ђ text, ʬ varchar, 1A char(16));
QUERY: create index גђindex1 on גђ using btree (ђ); create index גђindex1 on גђ using btree (ђ);
QUERY: create index גђindex2 on גђ using hash (ʬ); create index גђindex2 on גђ using hash (ʬ);
QUERY: insert into גђ values('Ԓ咡ǒג쒥','A01'); insert into גђ values('Ԓ咡ǒג쒥','A01');
QUERY: insert into גђ values('Ԓ咡钥ՒÒ','ʬB10'); insert into גђ values('Ԓ咡钥ՒÒ','ʬB10');
QUERY: insert into גђ values('Ԓ咡ג풥钥ޒ','Z01'); insert into גђ values('Ԓ咡ג풥钥ޒ','Z01');
QUERY: vacuum גђ; vacuum גђ;
QUERY: select * from גђ; select * from גђ;
ђ |ʬ|1a ђ | ʬ | 1a
---------------------------------------+---------------+-------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 |A01 | Ԓ咡ǒג쒥 | A01 |
Ԓ咡钥ՒÒ|ʬB10 | Ԓ咡钥ՒÒ | ʬB10 |
Ԓ咡ג풥钥ޒ |Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(3 rows) (3 rows)
QUERY: select * from גђ where ʬ = 'Z01'; select * from גђ where ʬ = 'Z01';
ђ |ʬ|1a ђ | ʬ | 1a
------------------------------------+---------------+-------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ|Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
QUERY: select * from גђ where ʬ ~* 'z01'; select * from גђ where ʬ ~* 'z01';
ђ |ʬ|1a ђ | ʬ | 1a
------------------------------------+---------------+-------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ|Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
QUERY: select * from גђ where ʬ like '_Z01_'; select * from גђ where ʬ like '_Z01_';
ђ |ʬ|1a ђ | ʬ | 1a
------------------------------------+---------------+-------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ|Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
QUERY: select * from גђ where ʬ like '_Z%'; select * from גђ where ʬ like '_Z%';
ђ |ʬ|1a ђ | ʬ | 1a
------------------------------------+---------------+-------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ|Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
QUERY: select * from גђ where ђ ~ 'Ԓ咡[ǒ]'; select * from גђ where ђ ~ 'Ԓ咡[ǒ]';
ђ |ʬ|1a ђ | ʬ | 1a
---------------------------------------+---------------+-------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 |A01 | Ԓ咡ǒג쒥 | A01 |
Ԓ咡钥ՒÒ|ʬB10 | Ԓ咡钥ՒÒ | ʬB10 |
(2 rows) (2 rows)
QUERY: select * from גђ where ђ ~* 'Ԓ咡[ǒ]'; select * from גђ where ђ ~* 'Ԓ咡[ǒ]';
ђ |ʬ|1a ђ | ʬ | 1a
---------------------------------------+---------------+-------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 |A01 | Ԓ咡ǒג쒥 | A01 |
Ԓ咡钥ՒÒ|ʬB10 | Ԓ咡钥ՒÒ | ʬB10 |
(2 rows) (2 rows)
QUERY: select *,character_length(ђ) from גђ; select *,character_length(ђ) from גђ;
ђ |ʬ|1a|length ђ | ʬ | 1a | char_length
---------------------------------------+---------------+--------------+------ -----------------------------------------+-----------------+----------------+-------------
Ԓ咡ǒג쒥 |A01 | | 12 Ԓ咡ǒג쒥 | A01 | | 12
Ԓ咡钥ՒÒ|ʬB10 | | 13 Ԓ咡钥ՒÒ | ʬB10 | | 13
Ԓ咡ג풥钥ޒ |Z01 | | 12 Ԓ咡ג풥钥ޒ | Z01 | | 12
(3 rows) (3 rows)
QUERY: select *,octet_length(ђ) from גђ; select *,octet_length(ђ) from גђ;
ђ |ʬ|1a|octet_length ђ | ʬ | 1a | octet_length
---------------------------------------+---------------+--------------+------------ -----------------------------------------+-----------------+----------------+--------------
Ԓ咡ǒג쒥 |A01 | | 36 Ԓ咡ǒג쒥 | A01 | | 36
Ԓ咡钥ՒÒ|ʬB10 | | 39 Ԓ咡钥ՒÒ | ʬB10 | | 39
Ԓ咡ג풥钥ޒ |Z01 | | 36 Ԓ咡ג풥钥ޒ | Z01 | | 36
(3 rows) (3 rows)
QUERY: select *,position('' in ђ) from גђ; select *,position('' in ђ) from גђ;
ђ |ʬ|1a|strpos ђ | ʬ | 1a | strpos
---------------------------------------+---------------+--------------+------ -----------------------------------------+-----------------+----------------+--------
Ԓ咡ǒג쒥 |A01 | | 7 Ԓ咡ǒג쒥 | A01 | | 7
Ԓ咡钥ՒÒ|ʬB10 | | 0 Ԓ咡钥ՒÒ | ʬB10 | | 0
Ԓ咡ג풥钥ޒ |Z01 | | 0 Ԓ咡ג풥钥ޒ | Z01 | | 0
(3 rows) (3 rows)
QUERY: select *,substring(ђ from 10 for 4) from גђ; select *,substring(ђ from 10 for 4) from גђ;
ђ |ʬ|1a|substr ђ | ʬ | 1a | substr
---------------------------------------+---------------+--------------+------------ -----------------------------------------+-----------------+----------------+--------------
Ԓ咡ǒג쒥 |A01 | |ג쒥 Ԓ咡ǒג쒥 | A01 | | ג쒥
Ԓ咡钥ՒÒ|ʬB10 | |Ò Ԓ咡钥ՒÒ | ʬB10 | | Ò
Ԓ咡ג풥钥ޒ |Z01 | |钥ޒ Ԓ咡ג풥钥ޒ | Z01 | | 钥ޒ
(3 rows) (3 rows)
QUERY: drop table Ƒ㑻; drop table Ƒ㑻;
ERROR: Relation 'Ƒ㑻' does not exist ERROR: Relation 'Ƒ㑻' does not exist
QUERY: create table Ƒ㑻( text, ֑ varchar, ע1A char(16)); create table Ƒ㑻( text, ֑ varchar, ע1A char(16));
QUERY: create index Ƒ㑻index1 on Ƒ㑻 using btree(); create index Ƒ㑻index1 on Ƒ㑻 using btree();
QUERY: create index Ƒ㑻index2 on Ƒ㑻 using btree(֑); create index Ƒ㑻index2 on Ƒ㑻 using btree(֑);
QUERY: insert into Ƒ㑻 values('ԑԑʾ','A01'); insert into Ƒ㑻 values('ԑԑʾ','A01');
QUERY: insert into Ƒ㑻 values('ԑͼ','B01'); insert into Ƒ㑻 values('ԑͼ','B01');
QUERY: insert into Ƒ㑻 values('ԑ̑Ա','Z01'); insert into Ƒ㑻 values('ԑ̑Ա','Z01');
QUERY: vacuum Ƒ㑻; vacuum Ƒ㑻;
QUERY: select * from Ƒ㑻; select * from Ƒ㑻;
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑԑʾ|A01| ԑԑʾ | A01 |
ԑͼ |B01| ԑͼ | B01 |
ԑ̑Ա|Z01| ԑ̑Ա | Z01 |
(3 rows) (3 rows)
QUERY: select * from Ƒ㑻 where ֑ = 'Z01'; select * from Ƒ㑻 where ֑ = 'Z01';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑ̑Ա|Z01| ԑ̑Ա | Z01 |
(1 row) (1 row)
QUERY: select * from Ƒ㑻 where ֑ ~* 'z01'; select * from Ƒ㑻 where ֑ ~* 'z01';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑ̑Ա|Z01| ԑ̑Ա | Z01 |
(1 row) (1 row)
QUERY: select * from Ƒ㑻 where ֑ like '_Z01_'; select * from Ƒ㑻 where ֑ like '_Z01_';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑ̑Ա|Z01| ԑ̑Ա | Z01 |
(1 row) (1 row)
QUERY: select * from Ƒ㑻 where ֑ like '_Z%'; select * from Ƒ㑻 where ֑ like '_Z%';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑ̑Ա|Z01| ԑ̑Ա | Z01 |
(1 row) (1 row)
QUERY: select * from Ƒ㑻 where ~ '[ԑͼ]'; select * from Ƒ㑻 where ~ '[ԑͼ]';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑԑʾ|A01| ԑԑʾ | A01 |
ԑͼ |B01| ԑͼ | B01 |
(2 rows) (2 rows)
QUERY: select * from Ƒ㑻 where ~* '[ԑͼ]'; select * from Ƒ㑻 where ~* '[ԑͼ]';
|֑|ע1a | ֑ | ע1a
---------------+---------+-------- -----------------+-----------+----------
ԑԑʾ|A01| ԑԑʾ | A01 |
ԑͼ |B01| ԑͼ | B01 |
(2 rows) (2 rows)
QUERY: select *,character_length() from Ƒ㑻; select *,character_length() from Ƒ㑻;
|֑|ע1a|length | ֑ | ע1a | char_length
---------------+---------+--------+------ -----------------+-----------+----------+-------------
ԑԑʾ|A01| | 5 ԑԑʾ | A01 | | 5
ԑͼ |B01| | 4 ԑͼ | B01 | | 4
ԑ̑Ա|Z01| | 5 ԑ̑Ա | Z01 | | 5
(3 rows) (3 rows)
QUERY: select *,octet_length() from Ƒ㑻; select *,octet_length() from Ƒ㑻;
|֑|ע1a|octet_length | ֑ | ע1a | octet_length
---------------+---------+--------+------------ -----------------+-----------+----------+--------------
ԑԑʾ|A01| | 15 ԑԑʾ | A01 | | 15
ԑͼ |B01| | 12 ԑͼ | B01 | | 12
ԑ̑Ա|Z01| | 15 ԑ̑Ա | Z01 | | 15
(3 rows) (3 rows)
QUERY: select *,position('' in ) from Ƒ㑻; select *,position('' in ) from Ƒ㑻;
|֑|ע1a|strpos | ֑ | ע1a | strpos
---------------+---------+--------+------ -----------------+-----------+----------+--------
ԑԑʾ|A01| | 3 ԑԑʾ | A01 | | 3
ԑͼ |B01| | 0 ԑͼ | B01 | | 0
ԑ̑Ա|Z01| | 0 ԑ̑Ա | Z01 | | 0
(3 rows) (3 rows)
QUERY: select *,substring( from 3 for 4) from Ƒ㑻; select *,substring( from 3 for 4) from Ƒ㑻;
|֑|ע1a|substr | ֑ | ע1a | substr
---------------+---------+--------+--------- -----------------+-----------+----------+-----------
ԑԑʾ|A01| |ԑʾ ԑԑʾ | A01 | | ԑʾ
ԑͼ |B01| |ͼ ԑͼ | B01 | | ͼ
ԑ̑Ա|Z01| |̑Ա ԑ̑Ա | Z01 | | ̑Ա
(3 rows) (3 rows)
QUERY: drop table ͪߩѦ듾; drop table ͪߩѦ듾;
ERROR: Relation 'ͪߩѦ듾' does not exist ERROR: Relation 'ͪߩѦ듾' does not exist
QUERY: create table ͪߩѦ듾 (듾 text, “׾ړ varchar, 1A󓱸 char(16)); create table ͪߩѦ듾 (듾 text, “׾ړ varchar, 1A󓱸 char(16));
QUERY: create index ͪߩѦ듾index1 on ͪߩѦ듾 using btree (듾); create index ͪߩѦ듾index1 on ͪߩѦ듾 using btree (듾);
QUERY: create index ͪߩѦ듾index2 on ͪߩѦ듾 using hash (“׾ړ); create index ͪߩѦ듾index2 on ͪߩѦ듾 using hash (“׾ړ);
QUERY: insert into ͪߩѦ듾 values('ēǻ͓𓽺Ó', 'ѦA01߾'); insert into ͪߩѦ듾 values('ēǻ͓𓽺Ó', 'ѦA01߾');
QUERY: insert into ͪߩѦ듾 values('ēǻ͓דȓ', 'B10'); insert into ͪߩѦ듾 values('ēǻ͓דȓ', 'B10');
QUERY: insert into ͪߩѦ듾 values('ēǻ͓Γד', 'Z01'); insert into ͪߩѦ듾 values('ēǻ͓Γד', 'Z01');
QUERY: vacuum ͪߩѦ듾; vacuum ͪߩѦ듾;
QUERY: select * from ͪߩѦ듾; select * from ͪߩѦ듾;
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó|ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
ēǻ͓דȓ |B10 | ēǻ͓דȓ | B10 |
ēǻ͓Γד|Z01 | ēǻ͓Γד | Z01 |
(3 rows) (3 rows)
QUERY: select * from ͪߩѦ듾 where “׾ړ = 'Z01'; select * from ͪߩѦ듾 where “׾ړ = 'Z01';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓Γד|Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
QUERY: select * from ͪߩѦ듾 where “׾ړ ~* 'z01'; select * from ͪߩѦ듾 where “׾ړ ~* 'z01';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓Γד|Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
QUERY: select * from ͪߩѦ듾 where “׾ړ like '_Z01_'; select * from ͪߩѦ듾 where “׾ړ like '_Z01_';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓Γד|Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
QUERY: select * from ͪߩѦ듾 where “׾ړ like '_Z%'; select * from ͪߩѦ듾 where “׾ړ like '_Z%';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓Γד|Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
QUERY: select * from ͪߩѦ듾 where 듾 ~ 'ēǻ[]'; select * from ͪߩѦ듾 where 듾 ~ 'ēǻ[]';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó|ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
ēǻ͓דȓ |B10 | ēǻ͓דȓ | B10 |
(2 rows) (2 rows)
QUERY: select * from ͪߩѦ듾 where 듾 ~* 'ēǻ[]'; select * from ͪߩѦ듾 where 듾 ~* 'ēǻ[]';
듾 |“׾ړ|1a󓱸 듾 | “׾ړ | 1a󓱸
------------------------+------------+-------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó|ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
ēǻ͓דȓ |B10 | ēǻ͓דȓ | B10 |
(2 rows) (2 rows)
QUERY: select *,character_length(듾) from ͪߩѦ듾; select *,character_length(듾) from ͪߩѦ듾;
듾 |“׾ړ|1a󓱸|length 듾 | “׾ړ | 1a󓱸 | char_length
------------------------+------------+--------------+------ --------------------------+--------------+----------------+-------------
ēǻ͓𓽺Ó|ѦA01߾ | | 8 ēǻ͓𓽺Ó | ѦA01߾ | | 8
ēǻ͓דȓ |B10 | | 7 ēǻ͓דȓ | B10 | | 7
ēǻ͓Γד|Z01 | | 8 ēǻ͓Γד | Z01 | | 8
(3 rows) (3 rows)
QUERY: select *,octet_length(듾) from ͪߩѦ듾; select *,octet_length(듾) from ͪߩѦ듾;
듾 |“׾ړ|1a󓱸|octet_length 듾 | “׾ړ | 1a󓱸 | octet_length
------------------------+------------+--------------+------------ --------------------------+--------------+----------------+--------------
ēǻ͓𓽺Ó|ѦA01߾ | | 24 ēǻ͓𓽺Ó | ѦA01߾ | | 24
ēǻ͓דȓ |B10 | | 21 ēǻ͓דȓ | B10 | | 21
ēǻ͓Γד|Z01 | | 24 ēǻ͓Γד | Z01 | | 24
(3 rows) (3 rows)
QUERY: select *,position('' in 듾) from ͪߩѦ듾; select *,position('' in 듾) from ͪߩѦ듾;
듾 |“׾ړ|1a󓱸|strpos 듾 | “׾ړ | 1a󓱸 | strpos
------------------------+------------+--------------+------ --------------------------+--------------+----------------+--------
ēǻ͓𓽺Ó|ѦA01߾ | | 4 ēǻ͓𓽺Ó | ѦA01߾ | | 4
ēǻ͓דȓ |B10 | | 0 ēǻ͓דȓ | B10 | | 0
ēǻ͓Γד|Z01 | | 0 ēǻ͓Γד | Z01 | | 0
(3 rows) (3 rows)
QUERY: select *,substring(듾 from 3 for 4) from ͪߩѦ듾; select *,substring(듾 from 3 for 4) from ͪߩѦ듾;
듾 |“׾ړ|1a󓱸|substr 듾 | “׾ړ | 1a󓱸 | substr
------------------------+------------+--------------+------------ --------------------------+--------------+----------------+--------------
ēǻ͓𓽺Ó|ѦA01߾ | |͓𓽺 ēǻ͓𓽺Ó | ѦA01߾ | | ͓𓽺
ēǻ͓דȓ |B10 | |͓ד ēǻ͓דȓ | B10 | | ͓ד
ēǻ͓Γד|Z01 | |͓Γ ēǻ͓Γד | Z01 | | ͓Γ
(3 rows) (3 rows)
QUERY: drop table test; drop table test;
ERROR: Relation 'test' does not exist ERROR: Relation 'test' does not exist
QUERY: create table test (t text); create table test (t text);
QUERY: insert into test values('ENGLISH'); insert into test values('ENGLISH');
QUERY: insert into test values('FRANAIS'); insert into test values('FRANAIS');
QUERY: insert into test values('ESPAOL'); insert into test values('ESPAOL');
QUERY: insert into test values('SLENSKA'); insert into test values('SLENSKA');
QUERY: insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA'); insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA');
QUERY: vacuum test; vacuum test;
QUERY: select * from test; select * from test;
t t
------------------------------------ --------------------------------------
ENGLISH ENGLISH
FRANAIS FRANAIS
ESPAOL ESPAOL
SLENSKA SLENSKA
ENGLISH FRANAIS ESPAOL SLENSKA ENGLISH FRANAIS ESPAOL SLENSKA
(5 rows) (5 rows)
QUERY: select * from test where t = 'ESPAOL'; select * from test where t = 'ESPAOL';
t t
-------- ----------
ESPAOL ESPAOL
(1 row) (1 row)
QUERY: select * from test where t ~* 'espaol'; select * from test where t ~* 'espaol';
t t
------------------------------------ --------------------------------------
ESPAOL ESPAOL
ENGLISH FRANAIS ESPAOL SLENSKA ENGLISH FRANAIS ESPAOL SLENSKA
(2 rows) (2 rows)
QUERY: select *,character_length(t) from test; select *,character_length(t) from test;
t |length t | char_length
------------------------------------+------ --------------------------------------+-------------
ENGLISH | 7 ENGLISH | 7
FRANAIS | 8 FRANAIS | 8
ESPAOL | 7 ESPAOL | 7
SLENSKA | 8 SLENSKA | 8
ENGLISH FRANAIS ESPAOL SLENSKA| 33 ENGLISH FRANAIS ESPAOL SLENSKA | 33
(5 rows) (5 rows)
QUERY: select *,octet_length(t) from test; select *,octet_length(t) from test;
t |octet_length t | octet_length
------------------------------------+------------ --------------------------------------+--------------
ENGLISH | 7 ENGLISH | 7
FRANAIS | 9 FRANAIS | 9
ESPAOL | 8 ESPAOL | 8
SLENSKA | 9 SLENSKA | 9
ENGLISH FRANAIS ESPAOL SLENSKA| 36 ENGLISH FRANAIS ESPAOL SLENSKA | 36
(5 rows) (5 rows)
QUERY: select *,position('L' in t) from test; select *,position('L' in t) from test;
t |strpos t | strpos
------------------------------------+------ --------------------------------------+--------
ENGLISH | 4 ENGLISH | 4
FRANAIS | 0 FRANAIS | 0
ESPAOL | 7 ESPAOL | 7
SLENSKA | 3 SLENSKA | 3
ENGLISH FRANAIS ESPAOL SLENSKA| 4 ENGLISH FRANAIS ESPAOL SLENSKA | 4
(5 rows) (5 rows)
QUERY: select *,substring(t from 3 for 4) from test; select *,substring(t from 3 for 4) from test;
t |substr t | substr
------------------------------------+------ --------------------------------------+--------
ENGLISH |GLIS ENGLISH | GLIS
FRANAIS |ANA FRANAIS | ANA
ESPAOL |PAO ESPAOL | PAO
SLENSKA |LENS SLENSKA | LENS
ENGLISH FRANAIS ESPAOL SLENSKA|GLIS ENGLISH FRANAIS ESPAOL SLENSKA | GLIS
(5 rows) (5 rows)
...@@ -54,8 +54,8 @@ select * from computer_terms where term ~* 'computer [DG]'; ...@@ -54,8 +54,8 @@ select * from computer_terms where term ~* 'computer [DG]';
(2 rows) (2 rows)
select *,character_length(term) from computer_terms; select *,character_length(term) from computer_terms;
term | category | comments | length term | category | comments | char_length
---------------------+----------+------------------+-------- ---------------------+----------+------------------+-------------
computer display | X-A01-Y | a comment 1 | 16 computer display | X-A01-Y | a comment 1 | 16
computer graphics | T-B01-Y | a comment 2 | 17 computer graphics | T-B01-Y | a comment 2 | 17
computer programmer | S-Z01-Y | a comment 3 | 19 computer programmer | S-Z01-Y | a comment 3 | 19
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment