Re: multiple function execute using (func()).*

Поиск
Список
Период
Сортировка
От Jeff
Тема Re: multiple function execute using (func()).*
Дата
Msg-id 3914E2A9-CA96-4447-8DB1-D91B0BB9BB2D@torgo.978.org
обсуждение исходный текст
Ответ на multiple function execute using (func()).*  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-hackers
On Dec 8, 2008, at 5:15 PM, Merlin Moncure wrote:

> Hello,
>
> I've been bit by this about a million times:
>
> select (func()).* executes the function once per each field in the
> returned tuple.  See the example below:
>

I ran into this exact problem a week or two ago.

I didn't dig too far into it but I figured (func()).* was being  
expanded by the parser into func().a, func().b and friends. marking it  
stable didn't help.

It can be quite surprising, especially if func() is expensive (as was  
my case) or has side effects.

--
Jeff Trout <jeff@jefftrout.com>
http://www.stuarthamm.net/
http://www.dellsmartexitin.com/





В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: WIP: default values for function parameters
Следующее
От: Gregory Stark
Дата:
Сообщение: posix_fadvise v22