Re: Anonymous code block with parameters

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Anonymous code block with parameters
Дата
Msg-id 5420D986.4050404@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Anonymous code block with parameters  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
On 09/23/2014 07:20 AM, Petr Jelinek wrote:
>>
>>
>> So, to me, DO vs CREATE FUNCTION has nothing to do with passing
>> arguments and/or returning data.  It has to do with lifespan; single
>> call of the function body only, use DO, otherwise, create a function.
>>
> 
> Actually same thing happened with the DO implementation itself -
> creating anonymous/hidden temporary functions in the background was also
> considered but was decided it's not acceptable (for similar reason temp
> tables were rejected for WITH).
> 
> So we decided at least twice already that this kind of solution is bad,
> I don't know of any change that would invalidate the reasons for
> deciding that way so I don't see why they would suddenly become
> acceptable...

All good points. I was wrong to suggest just going for TEMPORARY
FUNCTION before, there's clearly a useful place for DO with parameters.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: proposal (9.5) : psql unicode border line styles
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: proposal: rounding up time value less than its unit.