Re: Writeable CTEs and side effects

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: Writeable CTEs and side effects
Дата
Msg-id 4ACDDDAA.20808@cs.helsinki.fi
обсуждение исходный текст
Ответ на Writeable CTEs and side effects  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Список pgsql-hackers
I wrote:
> 3)    WITH t1 AS
>     (UPDATE foo SET bar=bar+1 RETURNING *),
>     t2 AS
>     (UPDATE baz SET bat=bat+1 RETURNING *)
>     VALUES (true);
> 
> This isn't probably the most common situation either, but I think it's
> worth looking at; the user wants to update two different tables, but
> ignore the RETURNING data completely.  On IRC, this has been requested
> multiple times.  Even if we wouldn't agree that this feature is useful,
> it pretty much follows the semantics of example #1.

A bit off topic, but IMHO if we allow this case, we could allow
INSERT/UPDATE/DELETE without a RETURNING clause if the CTE isn't
referenced, so you could write this as:

WITH t1 AS
(UPDATE foo SET bar=bar+1),
t2 AS
(UPDATE baz SET bar=bar+1)
VALUES(true);


Regards,
Marko Tiikkaja



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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: COPY enhancements
Следующее
От: Robert Haas
Дата:
Сообщение: Re: COPY enhancements