Re: RfD: more powerful "any" types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-09 17:39:14
Message-ID: 3712.1252517954@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> Yes, that sounds about right. Is that not basically what Alvaro was
> looking for to start with? And is there an "any" array that could work
> for variadic functions like sprintf(), as well?

Well, no, because arrays are inherently all the same element type.
You could try to do sprintf as

sprintf(text, variadic anyarray) returns text

but this constrains all the arguments to be the same type, which is
not what you want. The variadic mechanism doesn't have the ability
to deal with what you're suggesting, and I'm not sure we want to try
to make it do that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-09 17:47:48 Re: corrupted double-linked list
Previous Message Ľubomír Varga 2009-09-09 17:34:49 Re: suggestion to improve planer