Re: variadic flag doesn't work with "any" type
От | Pavel Stehule |
---|---|
Тема | Re: variadic flag doesn't work with "any" type |
Дата | |
Msg-id | AANLkTikbBGJ-fafV6UTvXPSCnXsjrGopxLkKLVHVy8Oj@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: variadic flag doesn't work with "any" type (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: variadic flag doesn't work with "any" type
|
Список | pgsql-bugs |
2010/12/10 Tom Lane <tgl@sss.pgh.pa.us>: > Pavel Stehule <pavel.stehule@gmail.com> writes: >> 2010/12/9 Tom Lane <tgl@sss.pgh.pa.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? Pavel > >> sometimes can be interesting to use a VARIADIC value - so list of >> pairs (key, =C2=A0value) 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. =C2=A0So I see no interesting use-case for VARIADIC here. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0regards, tom lane >
В списке pgsql-bugs по дате отправления: