blob: 0a63fc6321a7013a0c12344cd15eabf361e2ac67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
drop table �v�Z�@�p��
create table �v�Z�@�p�� (�p�� text, ���ރR�[�h varchar, ���l1A���� char(16))
create index �v�Z�@�p��index1 on �v�Z�@�p�� using btree (�p��)
create index �v�Z�@�p��index2 on �v�Z�@�p�� using hash (���ރR�[�h)
insert into �v�Z�@�p�� values('�R���s���[�^�f�B�X�v���C','�@A01��')
insert into �v�Z�@�p�� values('�R���s���[�^�O���t�B�b�N�X','��B10��')
insert into �v�Z�@�p�� values('�R���s���[�^�v���O���}�[','�lZ01��')
vacuum �v�Z�@�p��
select * from �v�Z�@�p��
�p�� | ���ރR�[�h | ���l1a����
----------------------------+------------+------------
�R���s���[�^�f�B�X�v���C | �@A01�� |
�R���s���[�^�O���t�B�b�N�X | ��B10�� |
�R���s���[�^�v���O���}�[ | �lZ01�� |
(3 rows)
select * from �v�Z�@�p�� where ���ރR�[�h = '�lZ01��'
�p�� | ���ރR�[�h | ���l1a����
--------------------------+------------+------------
�R���s���[�^�v���O���}�[ | �lZ01�� |
(1 row)
select * from �v�Z�@�p�� where ���ރR�[�h ~* '�lz01��'
�p�� | ���ރR�[�h | ���l1a����
--------------------------+------------+------------
�R���s���[�^�v���O���}�[ | �lZ01�� |
(1 row)
select * from �v�Z�@�p�� where ���ރR�[�h like '_Z01_'
�p�� | ���ރR�[�h | ���l1a����
--------------------------+------------+------------
�R���s���[�^�v���O���}�[ | �lZ01�� |
(1 row)
select * from �v�Z�@�p�� where ���ރR�[�h like '_Z%'
�p�� | ���ރR�[�h | ���l1a����
--------------------------+------------+------------
�R���s���[�^�v���O���}�[ | �lZ01�� |
(1 row)
select * from �v�Z�@�p�� where �p�� ~ '�R���s���[�^[�f�O]'
�p�� | ���ރR�[�h | ���l1a����
----------------------------+------------+------------
�R���s���[�^�f�B�X�v���C | �@A01�� |
�R���s���[�^�O���t�B�b�N�X | ��B10�� |
(2 rows)
select * from �v�Z�@�p�� where �p�� ~* '�R���s���[�^[�f�O]'
�p�� | ���ރR�[�h | ���l1a����
----------------------------+------------+------------
�R���s���[�^�f�B�X�v���C | �@A01�� |
�R���s���[�^�O���t�B�b�N�X | ��B10�� |
(2 rows)
select *,character_length(�p��) from �v�Z�@�p��
�p�� | ���ރR�[�h | ���l1a���� | length
----------------------------+------------+------------+--------
�R���s���[�^�f�B�X�v���C | �@A01�� | | 12
�R���s���[�^�O���t�B�b�N�X | ��B10�� | | 13
�R���s���[�^�v���O���}�[ | �lZ01�� | | 12
(3 rows)
select *,octet_length(�p��) from �v�Z�@�p��
�p�� | ���ރR�[�h | ���l1a���� | octet_length
----------------------------+------------+------------+--------------
�R���s���[�^�f�B�X�v���C | �@A01�� | | 24
�R���s���[�^�O���t�B�b�N�X | ��B10�� | | 26
�R���s���[�^�v���O���}�[ | �lZ01�� | | 24
(3 rows)
select *,position('�f' in �p��) from �v�Z�@�p��
�p�� | ���ރR�[�h | ���l1a���� | strpos
----------------------------+------------+------------+--------
�R���s���[�^�f�B�X�v���C | �@A01�� | | 7
�R���s���[�^�O���t�B�b�N�X | ��B10�� | | 0
�R���s���[�^�v���O���}�[ | �lZ01�� | | 0
(3 rows)
select *,substring(�p�� from 10 for 4) from �v�Z�@�p��
�p�� | ���ރR�[�h | ���l1a���� | substr
----------------------------+------------+------------+----------
�R���s���[�^�f�B�X�v���C | �@A01�� | | �v���C
�R���s���[�^�O���t�B�b�N�X | ��B10�� | | �B�b�N�X
�R���s���[�^�v���O���}�[ | �lZ01�� | | ���}�[
(3 rows)
copy �v�Z�@�p�� to stdout
�R���s���[�^�f�B�X�v���C �@A01�� \N
�R���s���[�^�O���t�B�b�N�X ��B10�� \N
�R���s���[�^�v���O���}�[ �lZ01�� \N
|