From 06e2757277e746fde9eeca14a86f87b7a61ff5b7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 9 Apr 2009 17:39:50 +0000 Subject: Remove SQL-compatibility function cardinality(). It is not exactly clear how this ought to behave for multi-dimensional arrays. Per discussion, not having it at all seems better than having it with what might prove to be the wrong behavior. We can always add it later when we have consensus on the correct behavior. --- src/backend/utils/adt/arrayfuncs.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/backend/utils/adt/arrayfuncs.c') diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 8b36edc42fa..bc661ae4171 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.154 2009/04/05 22:28:59 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.155 2009/04/09 17:39:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1668,28 +1668,6 @@ array_length(PG_FUNCTION_ARGS) PG_RETURN_INT32(result); } -/* - * array_cardinality : - * SQL-spec alias for array_length(v, 1) - */ -Datum -array_cardinality(PG_FUNCTION_ARGS) -{ - ArrayType *v = PG_GETARG_ARRAYTYPE_P(0); - int *dimv; - int result; - - /* Sanity check: does it look like an array at all? */ - if (ARR_NDIM(v) <= 0 || ARR_NDIM(v) > MAXDIM) - PG_RETURN_NULL(); - - dimv = ARR_DIMS(v); - - result = dimv[0]; - - PG_RETURN_INT32(result); -} - /* * array_ref : * This routine takes an array pointer and a subscript array and returns -- cgit v1.2.3