Skip site navigation (1) Skip section navigation (2)

Re: variadic flag doesn't work with "any" type

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: variadic flag doesn't work with "any" type
Date: 2010-12-10 19:44:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
2010/12/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>> 2010/12/9 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>>> What exactly is the use-case for that?
>> I am working on function that can help with record updating. It's
>> based on polymorphic types. I would to allow a multiple modification
>> per one call - like UPDATE statement does.
>> some like:
>> record_set_fields(anyelement, key text, value "any" [, key text, value
>> "any" [..]]) returns anyelement
> OK, makes sense, since you don't want to constrain the values to be all
> the same datatype.

ok, can I send a patch?


>> sometimes can be interesting to use a VARIADIC value - so list of
>> pairs (key,  value) can be created dynamically - (now I don't talk if
>> this is good way or not).
> That can't work unless you constrain all the values to be text (to match
> the column-name parameters), which more or less defeats the entire point
> of the function.  So I see no interesting use-case for VARIADIC here.
>                        regards, tom lane

In response to


pgsql-bugs by date

Next:From: Tom LaneDate: 2010-12-11 15:44:33
Subject: Re: BUG #5788: I can drop table , with other user's table
Previous:From: Tom LaneDate: 2010-12-10 19:26:06
Subject: Re: variadic flag doesn't work with "any" type

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group