Re: RfD: more powerful "any" types

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-10 19:29:37
Message-ID: 603c8f070909101229o4cb60bf4sdce1fe1056fa586b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 10, 2009 at 3:15 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Sep 10, 2009 at 2:42 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> 2. Come up with some way to do the equivalent of "variadic any[]",
>>> ie, a variable number of not-all-the-same-type arguments.  (This isn't
>>> just a type-system problem, there's also the question of how the type
>>> information would be passed at runtime.  IIRC we have a solution at the
>>> C level but not for PLs.)
>
>> This also seems like a good idea.  Will pg_typeof() work for PL/pgsql?
>
> pg_typeof() applied to what?  The existing approach assumes we can make
> an array out of the variadic parameters, which isn't going to be the
> case here.

Oh. For some reason I thought that would still be possible. I don't
think it's worth designing a whole new PL/pgsql language construct
just to support this feature. Given that this should be a relatively
unusual type of function, asking people to write them in C doesn't
seem unreasonable.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-09-10 19:30:46 Re: RfD: more powerful "any" types
Previous Message Andrew Dunstan 2009-09-10 19:23:14 Re: Ragged CSV import