summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2001-09-14 17:46:40 +0000
committerBruce Momjian2001-09-14 17:46:40 +0000
commitc1fbf06654aca97a109a2346d182158e8f14ab01 (patch)
treec0e4e87bb80d3eca6a8dd5e6194dac791b630a5d /src/include
parente8d5b8d2901ddf1b4518ec0eb450028678f2082e (diff)
> Here's a revised patch. Changes:
> > 1. Now outputs '\\' instead of '\134' when using encode(bytea, 'escape') > Note that I ended up leaving \0 as \000 so that there are no ambiguities > when decoding something like, for example, \0123. > > 2. Fixed bug in byteain which allowed input values which were not valid > octals (e.g. \789), to be parsed as if they were octals. > > Joe > Here's rev 2 of the bytea string support patch. Changes: 1. Added missing declaration for MatchBytea function 2. Added PQescapeBytea to fe-exec.c 3. Applies cleanly on cvs tip from this afternoon I'm hoping that someone can review/approve/apply this before beta starts, so I guess I'd vote (not that it counts for much) to delay beta a few days :-) Joe Conway
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_operator.h16
-rw-r--r--src/include/catalog/pg_proc.h24
-rw-r--r--src/include/utils/builtins.h9
4 files changed, 43 insertions, 10 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index d583d886288..5008df24716 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.94 2001/09/08 15:24:00 petere Exp $
+ * $Id: catversion.h,v 1.95 2001/09/14 17:46:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200109081
+#define CATALOG_VERSION_NO 200109101
#endif
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index ef4806f17ab..4919e3e37b1 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_operator.h,v 1.92 2001/08/13 18:45:36 tgl Exp $
+ * $Id: pg_operator.h,v 1.93 2001/09/14 17:46:40 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -811,11 +811,15 @@ DATA(insert OID = 1921 ( "+" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_
/* bytea operators */
DATA(insert OID = 1955 ( "=" PGUID 0 b t t 17 17 16 1955 1956 1957 1957 byteaeq eqsel eqjoinsel ));
-DATA(insert OID = 1956 ( "<>" PGUID 0 b t f 17 17 16 1956 1955 0 0 byteane neqsel neqjoinsel ));
-DATA(insert OID = 1957 ( "<" PGUID 0 b t f 17 17 16 1959 1960 0 0 bytealt scalarltsel scalarltjoinsel ));
-DATA(insert OID = 1958 ( "<=" PGUID 0 b t f 17 17 16 1960 1959 0 0 byteale scalarltsel scalarltjoinsel ));
-DATA(insert OID = 1959 ( ">" PGUID 0 b t f 17 17 16 1957 1958 0 0 byteagt scalargtsel scalargtjoinsel ));
-DATA(insert OID = 1960 ( ">=" PGUID 0 b t f 17 17 16 1958 1957 0 0 byteage scalargtsel scalargtjoinsel ));
+DATA(insert OID = 1956 ( "<>" PGUID 0 b t f 17 17 16 1956 1955 0 0 byteane neqsel neqjoinsel ));
+DATA(insert OID = 1957 ( "<" PGUID 0 b t f 17 17 16 1959 1960 0 0 bytealt scalarltsel scalarltjoinsel ));
+DATA(insert OID = 1958 ( "<=" PGUID 0 b t f 17 17 16 1960 1959 0 0 byteale scalarltsel scalarltjoinsel ));
+DATA(insert OID = 1959 ( ">" PGUID 0 b t f 17 17 16 1957 1958 0 0 byteagt scalargtsel scalargtjoinsel ));
+DATA(insert OID = 1960 ( ">=" PGUID 0 b t f 17 17 16 1958 1957 0 0 byteage scalargtsel scalargtjoinsel ));
+DATA(insert OID = 2016 ( "~~" PGUID 0 b t f 17 17 16 0 2017 0 0 bytealike likesel likejoinsel ));
+#define OID_BYTEA_LIKE_OP 2016
+DATA(insert OID = 2017 ( "!~~" PGUID 0 b t f 17 17 16 0 2016 0 0 byteanlike nlikesel nlikejoinsel ));
+DATA(insert OID = 2018 ( "||" PGUID 0 b t f 17 17 17 0 0 0 0 byteacat - - ));
/*
* function prototypes
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index c6fb3599938..90718bc10ad 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.210 2001/09/08 01:10:20 tgl Exp $
+ * $Id: pg_proc.h,v 1.211 2001/09/14 17:46:40 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2740,6 +2740,28 @@ DESCR("larger of two");
DATA(insert OID = 1966 ( oidsmaller PGUID 12 f t t t 2 f 26 "26 26" 100 0 0 100 oidsmaller - ));
DESCR("smaller of two");
+DATA(insert OID = 2005 ( bytealike PGUID 12 f t t t 2 f 16 "17 17" 100 0 0 100 bytealike - ));
+DESCR("matches LIKE expression");
+DATA(insert OID = 2006 ( byteanlike PGUID 12 f t t t 2 f 16 "17 17" 100 0 0 100 byteanlike - ));
+DESCR("does not match LIKE expression");
+DATA(insert OID = 2007 ( like PGUID 12 f t t t 2 f 16 "17 17" 100 0 0 100 bytealike - ));
+DESCR("matches LIKE expression");
+DATA(insert OID = 2008 ( notlike PGUID 12 f t t t 2 f 16 "17 17" 100 0 0 100 byteanlike - ));
+DESCR("does not match LIKE expression");
+DATA(insert OID = 2009 ( like_escape PGUID 12 f t t t 2 f 17 "17 17" 100 0 0 100 like_escape_bytea - ));
+DESCR("convert match pattern to use backslash escapes");
+DATA(insert OID = 2010 ( length PGUID 12 f t t t 1 f 23 "17" 100 0 0 100 byteaoctetlen - ));
+DESCR("octet length");
+DATA(insert OID = 2011 ( byteacat PGUID 12 f t t t 2 f 17 "17 17" 100 0 0 100 byteacat - ));
+DESCR("concatenate");
+DATA(insert OID = 2012 ( substring PGUID 12 f t t t 3 f 17 "17 23 23" 100 0 0 100 bytea_substr - ));
+DESCR("return portion of string");
+DATA(insert OID = 2013 ( substring PGUID 14 f t t t 2 f 17 "17 23" 100 0 0 100 "select substring($1, $2, -1)" - ));
+DESCR("return portion of string");
+DATA(insert OID = 2014 ( position PGUID 12 f t t t 2 f 23 "17 17" 100 0 0 100 byteapos - ));
+DESCR("return position of substring");
+DATA(insert OID = 2015 ( btrim PGUID 12 f t t t 2 f 17 "17 17" 100 0 0 100 byteatrim - ));
+DESCR("trim both ends of string");
/*
* prototypes for functions pg_proc.c
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index cb3a0a8913b..671d72684d5 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.163 2001/09/06 04:57:29 ishii Exp $
+ * $Id: builtins.h,v 1.164 2001/09/14 17:46:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -421,6 +421,9 @@ extern Datum byteale(PG_FUNCTION_ARGS);
extern Datum byteagt(PG_FUNCTION_ARGS);
extern Datum byteage(PG_FUNCTION_ARGS);
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);
/* version.c */
extern Datum pgsql_version(PG_FUNCTION_ARGS);
@@ -434,7 +437,10 @@ extern Datum textlike(PG_FUNCTION_ARGS);
extern Datum textnlike(PG_FUNCTION_ARGS);
extern Datum texticlike(PG_FUNCTION_ARGS);
extern Datum texticnlike(PG_FUNCTION_ARGS);
+extern Datum bytealike(PG_FUNCTION_ARGS);
+extern Datum byteanlike(PG_FUNCTION_ARGS);
extern Datum like_escape(PG_FUNCTION_ARGS);
+extern Datum like_escape_bytea(PG_FUNCTION_ARGS);
/* oracle_compat.c */
extern Datum lower(PG_FUNCTION_ARGS);
@@ -443,6 +449,7 @@ extern Datum initcap(PG_FUNCTION_ARGS);
extern Datum lpad(PG_FUNCTION_ARGS);
extern Datum rpad(PG_FUNCTION_ARGS);
extern Datum btrim(PG_FUNCTION_ARGS);
+extern Datum byteatrim(PG_FUNCTION_ARGS);
extern Datum ltrim(PG_FUNCTION_ARGS);
extern Datum rtrim(PG_FUNCTION_ARGS);
extern Datum translate(PG_FUNCTION_ARGS);