¾�ΥС�������ʸ�� �� 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9.6 | 9.5 | 9.4 | 9.3 | 9.2 | 9.1 | 9.0 | 8.4 | 8.3 | 8.2 | 8.1 | 8.0 | 7.4 | 7.3 | 7.2

9.5. �Х��ʥ�ʸ����ؿ��ȱ黻��

����Ǥ�bytea�����ͤ�Ĵ�٤������뤿��δؿ��ȱ黻�ҤˤĤ����������ޤ���

SQL�Ǥϡ������ζ��ڤ�˥���ޤǤϤʤ�������ɤ�Ȥ�ʸ����ؿ��򡢤����Ĥ�������Ƥ��ޤ����ܺ٤�表9-8�򻲾Ȥ��Ƥ��������� �ޤ�PostgreSQL�ϡ������δؿ����Ф����̾�δؿ��ƤӽФ���ʸ����Ѥ���С��������󶡤��ޤ���表9-6�򻲾Ȥ��Ƥ��������ˡ�

表 9-8. SQL�Х��ʥ�ʸ����ؿ��ȱ黻��

�ؿ�����ͷ����������
string || string bytea ʸ������ E'\\\\Post'::bytea || E'\\047gres\\000'::bytea\\Post'gres\000
octet_length(string)int�Х��ʥ�ʸ������ΥХ��ȿ�octet_length(E'jo\\000se'::bytea)5
overlay(string placing string from int [for int])bytea ��ʬʸ������ִ� overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 2 for 3)T\\002\\003mas
position(substring in string)int���ꤷ����ʬʸ����ΰ���position(E'\\000om'::bytea in E'Th\\000omas'::bytea)3
substring(string [from int] [for int])bytea ��ʬʸ�������� substring(E'Th\\000omas'::bytea from 2 for 3)h\000o
trim([both] bytes from string) bytea ʸ����string����Ƭ���������ޤǤ�bytes�ΥХ��ȤΤߤ�ޤ��Ĺ��ʸ����������ޤ��� trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea)Tom

����¾��表9-9����󤹤�Х��ʥ������ؿ����Ȥ��ޤ������Τ����Ĥ��ϡ�表9-8����������ɸ��SQL��ʸ����ؿ���������뤿�������Ū�˻��Ѥ���Ƥ��ޤ���

表 9-9. ����¾�ΥХ��ʥ�ʸ����ؿ�

�ؿ�����ͷ����������
btrim(string bytea, bytes bytea)bytea bytes�ǻ��ꤵ�줿�Х��ȤΤߤ�ͭ�����Ĺ��ʸ�����string����Ƭ���������������ޤ��� btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea)trim
decode(string text, type text) bytea ������encode����沽���줿string��Х��ʥ�ʸ��������沽���ޤ��� �ѥ�᡼������encode�λ����Ʊ���Ǥ��� decode(E'123\\000456', 'escape')123\000456
encode(string bytea, type text) text �Х���ʸ�����ASCII�Τߤ�ɽ������沽���ޤ������ݡ��Ȥ���뷿��base64��hex�������escape�Ǥ� encode(E'123\\000456'::bytea, 'escape')123\000456
get_bit(string, offset) int ʸ���󤫤�1�ӥå���Ф��ޤ��� get_bit(E'Th\\000omas'::bytea, 45)1
get_byte(string, offset) int ʸ���󤫤�1�Х�����Ф��ޤ��� get_byte(E'Th\\000omas'::bytea, 4)109
length(string)int �Х��ʥ�ʸ�����Ĺ�� length(E'jo\\000se'::bytea)5
md5(string)text string��MD5�Υϥå����׻�������̤�16�ʿ����֤��ޤ��� md5(E'Th\\000omas'::bytea)8ab2d3c9689aaf18 b4958c334c82d8b1
set_bit(string, offset, newvalue) bytea ʸ������ΥӥåȤ����ꤷ�ޤ��� set_bit(E'Th\\000omas'::bytea, 45, 0)Th\000omAs
set_byte(string, offset, newvalue) bytea ʸ�������1�Х��Ȥ����ꤷ�ޤ��� set_byte(E'Th\\000omas'::bytea, 4, 64)Th\000o@as

get_byte��set_byte�ϥХ��ʥ������Ƭ�Х��Ȥ�0�Х��ȤȤ��ƿ����ޤ���get_bit��set_bit�ϳƥХ�����򱦤���ӥåȤ�����ޤ����㤨�Хӥå�0����Ƭ�Х��ȤκDz��̥ӥåȤȤʤꡢ�ӥå�15������Х��ȤκǾ�̥ӥåȤȤʤ�ޤ���