aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-06-16 01:27:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-06-16 01:27:00 +0000
commitd70a42e6424e1531355ce9d1d1aa59e329b3c0e6 (patch)
treea562d86d0f5128916ecfd213906996a12940335e /src/include/utils/array.h
parent8e7349b73806a993f72976bbf7dfaa9b1cf270b8 (diff)
downloadpostgresql-d70a42e6424e1531355ce9d1d1aa59e329b3c0e6.tar.gz
postgresql-d70a42e6424e1531355ce9d1d1aa59e329b3c0e6.zip
Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names. Allow pg_cast entries to represent both type coercion and length coercion in a single step --- this is represented by a function that takes an extra typmod argument, just like a length coercion function. This nicely merges the type and length coercion mechanisms into something at least a little cleaner than we had before. Make use of the single- coercion-step behavior to fix integer-to-bit coercion so that coercing to bit(n) yields the rightmost n bits of the integer instead of the leftmost n bits. This should fix recurrent complaints about the odd behavior of this coercion. Clean up the documentation of the bit string functions, and try to put it where people might actually find it. Also, get rid of the unreliable heuristics in ruleutils.c about whether to display nested coercion steps; instead require parse_coerce.c to label them properly in the first place.
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index 596cf79d4d3..3114aefe10b 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.47 2004/06/06 00:41:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.48 2004/06/16 01:26:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -116,7 +116,6 @@ extern Datum array_in(PG_FUNCTION_ARGS);
extern Datum array_out(PG_FUNCTION_ARGS);
extern Datum array_recv(PG_FUNCTION_ARGS);
extern Datum array_send(PG_FUNCTION_ARGS);
-extern Datum array_length_coerce(PG_FUNCTION_ARGS);
extern Datum array_eq(PG_FUNCTION_ARGS);
extern Datum array_ne(PG_FUNCTION_ARGS);
extern Datum array_lt(PG_FUNCTION_ARGS);
@@ -128,6 +127,8 @@ extern Datum array_dims(PG_FUNCTION_ARGS);
extern Datum array_lower(PG_FUNCTION_ARGS);
extern Datum array_upper(PG_FUNCTION_ARGS);
extern Datum array_type_coerce(PG_FUNCTION_ARGS);
+extern Datum array_type_length_coerce(PG_FUNCTION_ARGS);
+extern Datum array_length_coerce(PG_FUNCTION_ARGS);
extern Datum array_ref(ArrayType *array, int nSubscripts, int *indx,
int arraylen, int elmlen, bool elmbyval, char elmalign,