Re: RfD: more powerful "any" types - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: RfD: more powerful "any" types
Date
Msg-id 20090909172423.GP4132@alvh.no-ip.org
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RfD: more powerful "any" types
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Another possible example is sprintf:
> 
> > create function sprintf(text, anyelement, anyelement2, anyelement3, ...)
> > returns text
> 
> > In order for this to work in general, we'd need FUNC_MAX_ARGS different
> > types, which is currently defined as 100 in our code.
> 
> But here, "any" would work perfectly fine, since there's no need for
> any two arguments to be tied to each other or the result.

Yup.

BTW does "any" match other pseudotypes?  Would I be able to pass a
cstring into "any"?  That would create a large security hole I think.

> Given that we've got away so far with only 1 instance of anyelement,
> I'm not really convinced that there's a market for more than anyelement2
> (and anyarray2, etc).

Well, if we have something general like a constrained "any", then I
agree.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: "David E. Wheeler"
Date:
Subject: Re: RfD: more powerful "any" types