Re: Anonymous Code Blocks as Lambdas?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Anonymous Code Blocks as Lambdas?
Дата
Msg-id 15170.1256588465@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Anonymous Code Blocks as Lambdas?  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Anonymous Code Blocks as Lambdas?  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> David E. Wheeler wrote:
>> Very excited about the new `DO` command in 8.5a2. I read through the 
>> patch review thread and found that, like me, Dim had expected it to 
>> behave more like a lambda than a simple command.

> It was discussed and rejected, at least for now. See earlier discussion.

A lambda facility would require being able to pass arguments and return
results, which we intentionally left out of DO to keep it simple.  By
the time you add all that notation, it's far from clear that you
shouldn't just define a function.

Also, DO is (intended to be) optimized for execute-once behavior.
A lambda block inside a query shouldn't assume that.  So it would not be
the same facility from either a syntax or an implementation standpoint.
        regards, tom lane


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Anonymous Code Blocks as Lambdas?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Proposal: String key space for advisory locks