Re: DECLARE CURSOR must not contain data-modifying statements in WITH

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: DECLARE CURSOR must not contain data-modifying statements in WITH
Дата
Msg-id CA+TgmobCKwc=bDfP64n91e1KKkM2OkcON61RuV-gWgK2x5mFxQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DECLARE CURSOR must not contain data-modifying statements in WITH  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Fri, Sep 23, 2011 at 10:53 AM, Andres Freund <andres@anarazel.de> wrote:
> One could argue that its a easier to implement it using a wCTE because the
> query will be simply materialize the query upfront.
> That makes handling the case where somebody fetches 3 tuples from a query
> updating 10 easier.
>
> Thats a bit harder for the normal cursor case because there is no tuplestore
> around to do that (except the WITH HOLD case where that is only used on
> commit...).
>
> I find it an acceptable way to enforce using a CTE to do cursors on DML because
> it makes it more clear that they will be fully executed on start...

Hmm, maybe.  But if that's true, why does the comment read the way it
does?  If the updates all occur at the beginning, that wouldn't be
"surprising", would it?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [pgsql-advocacy] Unlogged vs. In-Memory
Следующее
От: Greg Stark
Дата:
Сообщение: Re: memory barriers (was: Yes, WaitLatch is vulnerable to weak-memory-ordering bugs)