aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-11-08 17:27:03 +0000
committerBruce Momjian <bruce@momjian.us>2002-11-08 17:27:03 +0000
commitfef731d1c40e0cfd98d8a3cb724f696c9abe6f7d (patch)
treeedc1a42799af6f7f84b8be0bb1ce036946e92168 /src/include/utils/array.h
parent7eb2b4b270fe956f987fc8acc0983ff161950bfd (diff)
downloadpostgresql-fef731d1c40e0cfd98d8a3cb724f696c9abe6f7d.tar.gz
postgresql-fef731d1c40e0cfd98d8a3cb724f696c9abe6f7d.zip
The "Allow easy display of usernames in a group (pg_hba.conf uses groups
now)" item on the open items, and subsequent plpgsql function I sent in, made me realize it was too hard to get the upper and lower bound of an array. The attached creates two functions that I think will be very useful when combined with the ability of plpgsql to return sets. array_lower(array, dim_num) - and - array_upper(array, dim_num) They return the value (as an int) of the upper and lower bound of the requested dim in the provided array. Joe Conway
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index 639d9dc3153..1d154f485eb 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: array.h,v 1.35 2002/09/18 21:35:24 tgl Exp $
+ * $Id: array.h,v 1.36 2002/11/08 17:27:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -85,6 +85,8 @@ extern Datum array_out(PG_FUNCTION_ARGS);
extern Datum array_length_coerce(PG_FUNCTION_ARGS);
extern Datum array_eq(PG_FUNCTION_ARGS);
extern Datum array_dims(PG_FUNCTION_ARGS);
+extern Datum array_lower(PG_FUNCTION_ARGS);
+extern Datum array_upper(PG_FUNCTION_ARGS);
extern Datum array_ref(ArrayType *array, int nSubscripts, int *indx,
int arraylen, int elmlen, bool elmbyval, char elmalign,