mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-05 14:19:19 +02:00
334 lines
14 KiB
Plaintext
334 lines
14 KiB
Plaintext
drop table ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
ERROR: Relation '’·×’»»’µ¡’ÍÑ’¸ì' does not exist
|
||
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 ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
-----------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å |
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ |
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||
(3 rows)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É = '’¿ÍZ01’²¼';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
--------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||
(1 row)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~* '’¿Íz01’²¼';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
--------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||
(1 row)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z01_';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
--------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||
(1 row)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z%';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
--------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||
(1 row)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
-----------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å |
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ |
|
||
(2 rows)
|
||
|
||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||
-----------------------------------------+-----------------+----------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å |
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ |
|
||
(2 rows)
|
||
|
||
select *,character_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | char_length
|
||
-----------------------------------------+-----------------+----------------+-------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 12
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | 13
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 12
|
||
(3 rows)
|
||
|
||
select *,octet_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | octet_length
|
||
-----------------------------------------+-----------------+----------------+--------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 36
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | 39
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 36
|
||
(3 rows)
|
||
|
||
select *,position('’¥Ç' in ’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | strpos
|
||
-----------------------------------------+-----------------+----------------+--------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 7
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | 0
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 0
|
||
(3 rows)
|
||
|
||
select *,substring(’ÍÑ’¸ì from 10 for 4) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | substr
|
||
-----------------------------------------+-----------------+----------------+--------------
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | ’¥×’¥ì’¥¤
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | ’¥£’¥Ã’¥¯’¥¹
|
||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | ’¥é’¥Þ’¡¼
|
||
(3 rows)
|
||
|
||
drop table ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
ERROR: Relation '‘¼Æ‘Ëã‘»ú‘Êõ‘Óï' does not exist
|
||
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 ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ |
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||
(3 rows)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ = '‘ÈËZ01‘ÏÂ';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||
(1 row)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ ~* '‘ÈËz01‘ÏÂ';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||
(1 row)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z01_';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||
(1 row)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z%';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||
(1 row)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~ '‘µç‘ÄÔ[‘Ïԑͼ]';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ |
|
||
(2 rows)
|
||
|
||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~* '‘µç‘ÄÔ[‘Ïԑͼ]';
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||
-----------------+-----------+----------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ |
|
||
(2 rows)
|
||
|
||
select *,character_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | char_length
|
||
-----------------+-----------+----------+-------------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 5
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | 4
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 5
|
||
(3 rows)
|
||
|
||
select *,octet_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | octet_length
|
||
-----------------+-----------+----------+--------------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 15
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | 12
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 15
|
||
(3 rows)
|
||
|
||
select *,position('‘ÏÔ' in ‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | strpos
|
||
-----------------+-----------+----------+--------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 3
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | 0
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 0
|
||
(3 rows)
|
||
|
||
select *,substring(‘Êõ‘Óï from 3 for 4) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | substr
|
||
-----------------+-----------+----------+-----------
|
||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | ‘Ïԑʾ‘ÆÁ
|
||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | ‘ͼ‘ÐÎ
|
||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | ‘³Ì‘Ðò‘Ô±
|
||
(3 rows)
|
||
|
||
drop table “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
ERROR: Relation '“ͪ“ß©“Ѧ“¿ë“¾î' does not exist
|
||
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 “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ |
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé |
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||
(3 rows)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå = '“ìÑZ01“ù»';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||
(1 row)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå ~* '“ìÑz01“ù»';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||
(1 row)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z01_';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||
(1 row)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z%';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||
(1 row)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~ '“ÄÄ“Ç»“ÅÍ[“µð“±×]';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ |
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé |
|
||
(2 rows)
|
||
|
||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~* '“ÄÄ“Ç»“ÅÍ[“µð“±×]';
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||
--------------------------+--------------+----------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ |
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé |
|
||
(2 rows)
|
||
|
||
select *,character_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | char_length
|
||
--------------------------+--------------+----------------+-------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 8
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | 7
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 8
|
||
(3 rows)
|
||
|
||
select *,octet_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | octet_length
|
||
--------------------------+--------------+----------------+--------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 24
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | 21
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 24
|
||
(3 rows)
|
||
|
||
select *,position('“µð' in “¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | strpos
|
||
--------------------------+--------------+----------------+--------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 4
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | 0
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 0
|
||
(3 rows)
|
||
|
||
select *,substring(“¿ë“¾î from 3 for 4) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | substr
|
||
--------------------------+--------------+----------------+--------------
|
||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | “ÅÍ“µð“½º“ÇÃ
|
||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | “ÅÍ“±×“·¡“ÇÈ
|
||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | “ÅÍ“ÇÁ“·Î“±×
|
||
(3 rows)
|
||
|
||
drop table test;
|
||
ERROR: Relation 'test' does not exist
|
||
create table test (t text);
|
||
insert into test values('ENGLISH');
|
||
insert into test values('FRAN<41>ÇAIS');
|
||
insert into test values('ESPA<50>ÑOL');
|
||
insert into test values('<27>ÍSLENSKA');
|
||
insert into test values('ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA');
|
||
vacuum test;
|
||
select * from test;
|
||
t
|
||
--------------------------------------
|
||
ENGLISH
|
||
FRAN<41>ÇAIS
|
||
ESPA<50>ÑOL
|
||
<20>ÍSLENSKA
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA
|
||
(5 rows)
|
||
|
||
select * from test where t = 'ESPA<50>ÑOL';
|
||
t
|
||
----------
|
||
ESPA<50>ÑOL
|
||
(1 row)
|
||
|
||
select * from test where t ~* 'espa<70>Ñol';
|
||
t
|
||
--------------------------------------
|
||
ESPA<50>ÑOL
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA
|
||
(2 rows)
|
||
|
||
select *,character_length(t) from test;
|
||
t | char_length
|
||
--------------------------------------+-------------
|
||
ENGLISH | 7
|
||
FRAN<41>ÇAIS | 8
|
||
ESPA<50>ÑOL | 7
|
||
<20>ÍSLENSKA | 8
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 33
|
||
(5 rows)
|
||
|
||
select *,octet_length(t) from test;
|
||
t | octet_length
|
||
--------------------------------------+--------------
|
||
ENGLISH | 7
|
||
FRAN<41>ÇAIS | 9
|
||
ESPA<50>ÑOL | 8
|
||
<20>ÍSLENSKA | 9
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 36
|
||
(5 rows)
|
||
|
||
select *,position('L' in t) from test;
|
||
t | strpos
|
||
--------------------------------------+--------
|
||
ENGLISH | 4
|
||
FRAN<41>ÇAIS | 0
|
||
ESPA<50>ÑOL | 7
|
||
<20>ÍSLENSKA | 3
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 4
|
||
(5 rows)
|
||
|
||
select *,substring(t from 3 for 4) from test;
|
||
t | substr
|
||
--------------------------------------+--------
|
||
ENGLISH | GLIS
|
||
FRAN<41>ÇAIS | AN<41>ÇA
|
||
ESPA<50>ÑOL | PA<50>ÑO
|
||
<20>ÍSLENSKA | LENS
|
||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | GLIS
|
||
(5 rows)
|
||
|