Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23e88e2

Browse files
committed
Document get/set bit/byte functions.
1 parent7816c7c commit23e88e2

File tree

2 files changed

+60
-7
lines changed

2 files changed

+60
-7
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.132 2002/11/23 04:04:43 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.133 2002/12/05 04:38:29 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -473,7 +473,8 @@ PostgreSQL documentation
473473
shown in <xref linkend="functions-math-bit-table">.
474474
Bit string arguments to <literal>&</literal>, <literal>|</literal>,
475475
and <literal>#</literal> must be of equal length. When bit
476-
shifting, the original length of the string is preserved, as shown in the table.
476+
shifting, the original length of the string is preserved, as shown
477+
in the table.
477478
</para>
478479

479480
<table id="functions-math-bit-table">
@@ -2120,6 +2121,58 @@ PostgreSQL documentation
21202121
<entry><literal>trim('\\000'::bytea from '\\000Tom\\000'::bytea)</literal></entry>
21212122
<entry><literal>Tom</literal></entry>
21222123
</row>
2124+
2125+
<row>
2126+
<entry><function>get_byte</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
2127+
<entry><type>integer</type></entry>
2128+
<entry>
2129+
Extract byte from string.
2130+
<indexterm>
2131+
<primary>get_byte</primary>
2132+
</indexterm>
2133+
</entry>
2134+
<entry><literal>get_byte('Th\\000omas'::bytea, 4)</literal></entry>
2135+
<entry><literal>109</literal></entry>
2136+
</row>
2137+
2138+
<row>
2139+
<entry><function>set_byte</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
2140+
<entry><type>bytea</type></entry>
2141+
<entry>
2142+
Set byte in string.
2143+
<indexterm>
2144+
<primary>set_byte</primary>
2145+
</indexterm>
2146+
</entry>
2147+
<entry><literal>set_byte('Th\\000omas'::bytea, 4, 64)</literal></entry>
2148+
<entry><literal>Th\000o@as</literal></entry>
2149+
</row>
2150+
2151+
<row>
2152+
<entry><function>get_bit</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
2153+
<entry><type>integer</type></entry>
2154+
<entry>
2155+
Extract bit from string.
2156+
<indexterm>
2157+
<primary>get_bit</primary>
2158+
</indexterm>
2159+
</entry>
2160+
<entry><literal>get_bit('Th\\000omas'::bytea, 45)</literal></entry>
2161+
<entry><literal>1</literal></entry>
2162+
</row>
2163+
2164+
<row>
2165+
<entry><function>set_bit</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
2166+
<entry><type>bytea</type></entry>
2167+
<entry>
2168+
Set bit in string.
2169+
<indexterm>
2170+
<primary>set_bit</primary>
2171+
</indexterm>
2172+
</entry>
2173+
<entry><literal>set_bit('Th\\000omas'::bytea, 45, 0)</literal></entry>
2174+
<entry><literal>Th\000omAs</literal></entry>
2175+
</row>
21232176
</tbody>
21242177
</tgroup>
21252178
</table>

‎src/include/catalog/pg_proc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.277 2002/12/04 05:18:36 momjian Exp $
10+
* $Id: pg_proc.h,v 1.278 2002/12/05 04:38:30 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -958,13 +958,13 @@ DESCR("less-than-or-equal");
958958
DATA(insertOID=720 (octet_lengthPGNSPPGUID12fftfi123"17"byteaoctetlen-_null_ ));
959959
DESCR("octet length");
960960
DATA(insertOID=721 (get_bytePGNSPPGUID12fftfi223"17 23"byteaGetByte-_null_ ));
961-
DESCR("");
961+
DESCR("get byte");
962962
DATA(insertOID=722 (set_bytePGNSPPGUID12fftfi317"17 23 23"byteaSetByte-_null_ ));
963-
DESCR("");
963+
DESCR("set byte");
964964
DATA(insertOID=723 (get_bitPGNSPPGUID12fftfi223"17 23"byteaGetBit-_null_ ));
965-
DESCR("");
965+
DESCR("get bit");
966966
DATA(insertOID=724 (set_bitPGNSPPGUID12fftfi317"17 23 23"byteaSetBit-_null_ ));
967-
DESCR("");
967+
DESCR("set bit");
968968

969969
DATA(insertOID=725 (dist_plPGNSPPGUID12fftfi2701"600 628"dist_pl-_null_ ));
970970
DESCR("distance between point and line");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp