1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

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.
This commit is contained in:
Tom Lane
2009-04-09 17:39:50 +00:00
parent 78f58f0f70
commit 06e2757277
8 changed files with 7 additions and 83 deletions

View File

@ -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