Re: [HACKERS] Missing array support - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] Missing array support
Date
Msg-id 17396.1057006221@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Missing array support  (Joe Conway <mail@joeconway.com>)
Responses Re: [HACKERS] Missing array support  (Joe Conway <mail@joeconway.com>)
List pgsql-patches
Joe Conway <mail@joeconway.com> writes:
> Are you referring to ANYELEMENT actually being an array at runtime?
> That's the first time I've heard that concept.

That was the behavior we agreed to some time ago, to avoid needing
to entangle ANY into the polymorphism logic.  See the comments for
check_generic_type_consistency:

 * The argument consistency rules are:
 *
 * 1) All arguments declared ANYARRAY must have matching datatypes,
 *      and must in fact be varlena arrays.
 * 2) All arguments declared ANYELEMENT must have matching datatypes.
 * 3) If there are arguments of both ANYELEMENT and ANYARRAY, make sure
 *    the actual ANYELEMENT datatype is in fact the element type for
 *    the actual ANYARRAY datatype.

If only ANYELEMENT and not ANYARRAY appears in a function declaration,
then it can stand for any type, because only rule 2 applies.  (The
difference from ANY is that multiple occurences of ANYELEMENT are all
constrained to stand for the same type.)

            regards, tom lane

pgsql-patches by date:

Previous
From: Aizaz Ahmed
Date:
Subject: Patch for listing runtime option details through server executable (pg_guc)
Next
From: Joe Conway
Date:
Subject: Re: [HACKERS] Missing array support