Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 444c5bf

Browse files
committed
SQL function bit_length
1 parent 8a987af commit 444c5bf

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

doc/src/sgml/func.sgml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.58 2001/05/12 22:51:34 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.59 2001/05/24 09:29:29 petere Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -775,6 +775,14 @@
775775
<entry>PostgreSQL</entry>
776776
</row>
777777

778+
<row>
779+
<entry>bit_length(<parameter>string</parameter>)</entry>
780+
<entry><type>integer</type></entry>
781+
<entry>number of bits in string</entry>
782+
<entry>bit_length('jose')</entry>
783+
<entry>32</entry>
784+
</row>
785+
778786
<row>
779787
<entry>char_length(<parameter>string</parameter>) or character_length(<parameter>string</parameter>)</entry>
780788
<entry><type>integer</type></entry>

src/include/catalog/pg_proc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.187 2001/05/22 16:37:16 petere Exp $
10+
* $Id: pg_proc.h,v 1.188 2001/05/24 09:29:29 petere Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2464,6 +2464,14 @@ DESCR("(internal)");
24642464
DATA(insert OID = 1799 ( oidout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 oidout - ));
24652465
DESCR("(internal)");
24662466

2467+
2468+
DATA(insert OID = 1810 ( bit_length PGUID 14 f t t t 1 f 23 "17" 100 0 0 100 "select octet_length($1) * 8" - ));
2469+
DESCR("length in bits");
2470+
DATA(insert OID = 1811 ( bit_length PGUID 14 f t t t 1 f 23 "25" 100 0 0 100 "select octet_length($1) * 8" - ));
2471+
DESCR("length in bits");
2472+
DATA(insert OID = 1812 ( bit_length PGUID 14 f t t t 1 f 23 "1560" 100 0 0 100 "select length($1)" - ));
2473+
DESCR("length in bits");
2474+
24672475
/* Selectivity estimators for LIKE and related operators */
24682476
DATA(insert OID = 1814 ( iclikesel PGUID 12 f t f t 4 f 701 "0 26 0 23" 100 0 0 100 iclikesel - ));
24692477
DESCR("restriction selectivity of ILIKE");

0 commit comments

Comments
 (0)