Document get/set bit/byte functions.
authorBruce Momjian
Thu, 5 Dec 2002 04:38:30 +0000 (04:38 +0000)
committerBruce Momjian
Thu, 5 Dec 2002 04:38:30 +0000 (04:38 +0000)
doc/src/sgml/func.sgml
src/include/catalog/pg_proc.h

index 1ca9371a2d79b352d13a3bbd1df4ad9afcfed1bf..d3b4e7555e1a0660abd6d1b796580b4d9f1a1662 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -473,7 +473,8 @@ PostgreSQL documentation
     shown in .
     Bit string arguments to &|,
     and # 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.
    
 
     
@@ -2120,6 +2121,58 @@ PostgreSQL documentation
        trim('\\000'::bytea from '\\000Tom\\000'::bytea)
        Tom
       
+
+      
+       get_byte(stringoffset)
+       integer
+       
+        Extract byte from string.
+        
+         get_byte
+        
+       
+       get_byte('Th\\000omas'::bytea, 4)
+       109
+      
+
+      
+       set_byte(stringoffset)
+       bytea
+       
+        Set byte in string.
+        
+         set_byte
+        
+       
+       set_byte('Th\\000omas'::bytea, 4, 64)
+       Th\000o@as
+      
+
+      
+       get_bit(stringoffset)
+       integer
+       
+        Extract bit from string.
+        
+         get_bit
+        
+       
+       get_bit('Th\\000omas'::bytea, 45)
+       1
+      
+
+      
+       set_bit(stringoffset)
+       bytea
+       
+        Set bit in string.
+        
+         set_bit
+        
+       
+       set_bit('Th\\000omas'::bytea, 45, 0)
+       Th\000omAs
+      
      
     
    
index a840eb22f0169ba5ecc84b01e43a8100995487af..2cc2b3519d9f2394f78456a54be59bf09c908789 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_proc.h,v 1.277 2002/12/04 05:18:36 momjian Exp $
+ * $Id: pg_proc.h,v 1.278 2002/12/05 04:38:30 momjian Exp $
  *
  * NOTES
  *   The script catalog/genbki.sh reads this file and generates .bki
@@ -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_ ));
 DESCR("octet length");
 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_ ));
-DESCR("");
+DESCR("set byte");
 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_ ));
-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_ ));
 DESCR("distance between point and line");