summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2002-08-22 03:24:01 +0000
committerBruce Momjian2002-08-22 03:24:01 +0000
commit89260124dbf300e7f28d43382bde09029a9b0cf4 (patch)
treeccd805ff14b24c9a82cde4c43d3d850f6398e58c /src/include
parentf6353c6ee4a11faa36141339a03a16bc25cd0b10 (diff)
Add:
replace(string, from, to) -- replaces all occurrences of "from" in "string" to "to" split(string, fldsep, column) -- splits "string" on "fldsep" and returns "column" number piece to_hex(int32_num) & to_hex(int64_num) -- takes integer number and returns as hex string Joe Conway
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/pg_proc.h20
-rw-r--r--src/include/utils/builtins.h8
2 files changed, 23 insertions, 5 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a9fe521845d..0b45d85ec93 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -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.260 2002/08/22 00:01:47 tgl Exp $
+ * $Id: pg_proc.h,v 1.261 2002/08/22 03:24:00 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2120,7 +2120,7 @@ DATA(insert OID = 881 ( ltrim PGNSP PGUID 14 f f t f i 1 25 "25" "select
DESCR("remove initial characters from string");
DATA(insert OID = 882 ( rtrim PGNSP PGUID 14 f f t f i 1 25 "25" "select rtrim($1, \' \')" - _null_ ));
DESCR("remove trailing characters from string");
-DATA(insert OID = 883 ( substr PGNSP PGUID 14 f f t f i 2 25 "25 23" "select substr($1, $2, -1)" - _null_ ));
+DATA(insert OID = 883 ( substr PGNSP PGUID 12 f f t f i 2 25 "25 23" text_substr_no_len - _null_ ));
DESCR("return portion of string");
DATA(insert OID = 884 ( btrim PGNSP PGUID 12 f f t f i 2 25 "25 25" btrim - _null_ ));
DESCR("trim both ends of string");
@@ -2129,8 +2129,16 @@ DESCR("trim both ends of string");
DATA(insert OID = 936 ( substring PGNSP PGUID 12 f f t f i 3 25 "25 23 23" text_substr - _null_ ));
DESCR("return portion of string");
-DATA(insert OID = 937 ( substring PGNSP PGUID 14 f f t f i 2 25 "25 23" "select substring($1, $2, -1)" - _null_ ));
+DATA(insert OID = 937 ( substring PGNSP PGUID 12 f f t f i 2 25 "25 23" text_substr_no_len - _null_ ));
DESCR("return portion of string");
+DATA(insert OID = 2087 ( replace PGNSP PGUID 12 f f t f i 3 25 "25 25 25" replace_text - _null_ ));
+DESCR("replace all occurrences of old_substr with new_substr in string");
+DATA(insert OID = 2088 ( split PGNSP PGUID 12 f f t f i 3 25 "25 25 23" split_text - _null_ ));
+DESCR("split string by field_sep and return field_num");
+DATA(insert OID = 2089 ( to_hex PGNSP PGUID 12 f f t f i 1 25 "23" to_hex32 - _null_ ));
+DESCR("convert int32 number to hex");
+DATA(insert OID = 2090 ( to_hex PGNSP PGUID 12 f f t f i 1 25 "20" to_hex64 - _null_ ));
+DESCR("convert int64 number to hex");
/* for multi-byte support */
@@ -2781,7 +2789,11 @@ DATA(insert OID = 2011 ( byteacat PGNSP PGUID 12 f f t f i 2 17 "17 17" byt
DESCR("concatenate");
DATA(insert OID = 2012 ( substring PGNSP PGUID 12 f f t f i 3 17 "17 23 23" bytea_substr - _null_ ));
DESCR("return portion of string");
-DATA(insert OID = 2013 ( substring PGNSP PGUID 14 f f t f i 2 17 "17 23" "select substring($1, $2, -1)" - _null_ ));
+DATA(insert OID = 2013 ( substring PGNSP PGUID 12 f f t f i 2 17 "17 23" bytea_substr_no_len - _null_ ));
+DESCR("return portion of string");
+DATA(insert OID = 2085 ( substr PGNSP PGUID 12 f f t f i 3 17 "17 23 23" bytea_substr - _null_ ));
+DESCR("return portion of string");
+DATA(insert OID = 2086 ( substr PGNSP PGUID 12 f f t f i 2 17 "17 23" bytea_substr_no_len - _null_ ));
DESCR("return portion of string");
DATA(insert OID = 2014 ( position PGNSP PGUID 12 f f t f i 2 23 "17 17" byteapos - _null_ ));
DESCR("return position of substring");
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index c18a17be9ae..bdee336b002 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.194 2002/08/22 00:01:49 tgl Exp $
+ * $Id: builtins.h,v 1.195 2002/08/22 03:24:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -467,12 +467,17 @@ extern Datum textlen(PG_FUNCTION_ARGS);
extern Datum textoctetlen(PG_FUNCTION_ARGS);
extern Datum textpos(PG_FUNCTION_ARGS);
extern Datum text_substr(PG_FUNCTION_ARGS);
+extern Datum text_substr_no_len(PG_FUNCTION_ARGS);
extern Datum name_text(PG_FUNCTION_ARGS);
extern Datum text_name(PG_FUNCTION_ARGS);
extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2);
extern List *textToQualifiedNameList(text *textval, const char *caller);
extern bool SplitIdentifierString(char *rawstring, char separator,
List **namelist);
+extern Datum replace_text(PG_FUNCTION_ARGS);
+extern Datum split_text(PG_FUNCTION_ARGS);
+extern Datum to_hex32(PG_FUNCTION_ARGS);
+extern Datum to_hex64(PG_FUNCTION_ARGS);
extern Datum unknownin(PG_FUNCTION_ARGS);
extern Datum unknownout(PG_FUNCTION_ARGS);
@@ -496,6 +501,7 @@ extern Datum byteacmp(PG_FUNCTION_ARGS);
extern Datum byteacat(PG_FUNCTION_ARGS);
extern Datum byteapos(PG_FUNCTION_ARGS);
extern Datum bytea_substr(PG_FUNCTION_ARGS);
+extern Datum bytea_substr_no_len(PG_FUNCTION_ARGS);
/* version.c */
extern Datum pgsql_version(PG_FUNCTION_ARGS);