diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-05 18:21:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-05 18:21:19 +0000 |
commit | b0c451e145be23211dce0718cc63e632959591e8 (patch) | |
tree | 54bd4895befb57950db391dfe0e77e6c41468419 /src/backend/utils/adt/varlena.c | |
parent | fd1843ff8979c0461fb3f1a9eab61140c977e32d (diff) | |
download | postgresql-b0c451e145be23211dce0718cc63e632959591e8.tar.gz postgresql-b0c451e145be23211dce0718cc63e632959591e8.zip |
Remove the single-argument form of string_agg(). It added nothing much in
functionality, while creating an ambiguity in usage with ORDER BY that at
least two people have already gotten seriously confused by. Also, add an
opr_sanity test to check that we don't in future violate the newly minted
policy of not having built-in aggregates with the same name and different
numbers of parameters. Per discussion of a complaint from Thom Brown.
Diffstat (limited to 'src/backend/utils/adt/varlena.c')
-rw-r--r-- | src/backend/utils/adt/varlena.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index be41c977ffb..e9f9f597ec7 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.177 2010/02/26 02:01:10 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.178 2010/08/05 18:21:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3320,7 +3320,7 @@ pg_column_size(PG_FUNCTION_ARGS) /* * string_agg - Concatenates values and returns string. * - * Syntax: string_agg(value text, delimiter text = '') RETURNS text + * Syntax: string_agg(value text, delimiter text) RETURNS text * * Note: Any NULL values are ignored. The first-call delimiter isn't * actually used at all, and on subsequent calls the delimiter precedes @@ -3359,28 +3359,6 @@ string_agg_transfn(PG_FUNCTION_ARGS) state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0); - /* Append the element unless null. */ - if (!PG_ARGISNULL(1)) - { - if (state == NULL) - state = makeStringAggState(fcinfo); - appendStringInfoText(state, PG_GETARG_TEXT_PP(1)); /* value */ - } - - /* - * The transition type for string_agg() is declared to be "internal", - * which is a pass-by-value type the same size as a pointer. - */ - PG_RETURN_POINTER(state); -} - -Datum -string_agg_delim_transfn(PG_FUNCTION_ARGS) -{ - StringInfo state; - - state = PG_ARGISNULL(0) ? NULL : (StringInfo) PG_GETARG_POINTER(0); - /* Append the value unless null. */ if (!PG_ARGISNULL(1)) { |