Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
23e88e25
Commit
23e88e25
authored
Dec 05, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document get/set bit/byte functions.
parent
7816c7cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
7 deletions
+60
-7
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+55
-2
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+5
-5
No files found.
doc/src/sgml/func.sgml
View file @
23e88e25
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.13
2 2002/11/23 04:04:43
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.13
3 2002/12/05 04:38:29
momjian Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -473,7 +473,8 @@ PostgreSQL documentation
...
@@ -473,7 +473,8 @@ PostgreSQL documentation
shown in <xref linkend="functions-math-bit-table">.
shown in <xref linkend="functions-math-bit-table">.
Bit string arguments to <literal>&</literal>, <literal>|</literal>,
Bit string arguments to <literal>&</literal>, <literal>|</literal>,
and <literal>#</literal> must be of equal length. When bit
and <literal>#</literal> must be of equal length. When bit
shifting, the original length of the string is preserved, as shown in the table.
shifting, the original length of the string is preserved, as shown
in the table.
</para>
</para>
<table id="functions-math-bit-table">
<table id="functions-math-bit-table">
...
@@ -2120,6 +2121,58 @@ PostgreSQL documentation
...
@@ -2120,6 +2121,58 @@ PostgreSQL documentation
<entry><literal>trim('\\000'::bytea from '\\000Tom\\000'::bytea)</literal></entry>
<entry><literal>trim('\\000'::bytea from '\\000Tom\\000'::bytea)</literal></entry>
<entry><literal>Tom</literal></entry>
<entry><literal>Tom</literal></entry>
</row>
</row>
<row>
<entry><function>get_byte</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
<entry><type>integer</type></entry>
<entry>
Extract byte from string.
<indexterm>
<primary>get_byte</primary>
</indexterm>
</entry>
<entry><literal>get_byte('Th\\000omas'::bytea, 4)</literal></entry>
<entry><literal>109</literal></entry>
</row>
<row>
<entry><function>set_byte</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
<entry><type>bytea</type></entry>
<entry>
Set byte in string.
<indexterm>
<primary>set_byte</primary>
</indexterm>
</entry>
<entry><literal>set_byte('Th\\000omas'::bytea, 4, 64)</literal></entry>
<entry><literal>Th\000o@as</literal></entry>
</row>
<row>
<entry><function>get_bit</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
<entry><type>integer</type></entry>
<entry>
Extract bit from string.
<indexterm>
<primary>get_bit</primary>
</indexterm>
</entry>
<entry><literal>get_bit('Th\\000omas'::bytea, 45)</literal></entry>
<entry><literal>1</literal></entry>
</row>
<row>
<entry><function>set_bit</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
<entry><type>bytea</type></entry>
<entry>
Set bit in string.
<indexterm>
<primary>set_bit</primary>
</indexterm>
</entry>
<entry><literal>set_bit('Th\\000omas'::bytea, 45, 0)</literal></entry>
<entry><literal>Th\000omAs</literal></entry>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
</table>
</table>
...
...
src/include/catalog/pg_proc.h
View file @
23e88e25
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: pg_proc.h,v 1.27
7 2002/12/04 05:18:36
momjian Exp $
* $Id: pg_proc.h,v 1.27
8 2002/12/05 04:38:30
momjian Exp $
*
*
* NOTES
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
* The script catalog/genbki.sh reads this file and generates .bki
...
@@ -958,13 +958,13 @@ DESCR("less-than-or-equal");
...
@@ -958,13 +958,13 @@ DESCR("less-than-or-equal");
DATA
(
insert
OID
=
720
(
octet_length
PGNSP
PGUID
12
f
f
t
f
i
1
23
"17"
byteaoctetlen
-
_null_
));
DATA
(
insert
OID
=
720
(
octet_length
PGNSP
PGUID
12
f
f
t
f
i
1
23
"17"
byteaoctetlen
-
_null_
));
DESCR
(
"octet length"
);
DESCR
(
"octet length"
);
DATA
(
insert
OID
=
721
(
get_byte
PGNSP
PGUID
12
f
f
t
f
i
2
23
"17 23"
byteaGetByte
-
_null_
));
DATA
(
insert
OID
=
721
(
get_byte
PGNSP
PGUID
12
f
f
t
f
i
2
23
"17 23"
byteaGetByte
-
_null_
));
DESCR
(
""
);
DESCR
(
"
get byte
"
);
DATA
(
insert
OID
=
722
(
set_byte
PGNSP
PGUID
12
f
f
t
f
i
3
17
"17 23 23"
byteaSetByte
-
_null_
));
DATA
(
insert
OID
=
722
(
set_byte
PGNSP
PGUID
12
f
f
t
f
i
3
17
"17 23 23"
byteaSetByte
-
_null_
));
DESCR
(
""
);
DESCR
(
"
set byte
"
);
DATA
(
insert
OID
=
723
(
get_bit
PGNSP
PGUID
12
f
f
t
f
i
2
23
"17 23"
byteaGetBit
-
_null_
));
DATA
(
insert
OID
=
723
(
get_bit
PGNSP
PGUID
12
f
f
t
f
i
2
23
"17 23"
byteaGetBit
-
_null_
));
DESCR
(
""
);
DESCR
(
"
get bit
"
);
DATA
(
insert
OID
=
724
(
set_bit
PGNSP
PGUID
12
f
f
t
f
i
3
17
"17 23 23"
byteaSetBit
-
_null_
));
DATA
(
insert
OID
=
724
(
set_bit
PGNSP
PGUID
12
f
f
t
f
i
3
17
"17 23 23"
byteaSetBit
-
_null_
));
DESCR
(
""
);
DESCR
(
"
set bit
"
);
DATA
(
insert
OID
=
725
(
dist_pl
PGNSP
PGUID
12
f
f
t
f
i
2
701
"600 628"
dist_pl
-
_null_
));
DATA
(
insert
OID
=
725
(
dist_pl
PGNSP
PGUID
12
f
f
t
f
i
2
701
"600 628"
dist_pl
-
_null_
));
DESCR
(
"distance between point and line"
);
DESCR
(
"distance between point and line"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment