Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules
От | Martijn van Oosterhout |
---|---|
Тема | Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules |
Дата | |
Msg-id | 20140617071818.GB9121@svana.org обсуждение исходный текст |
Ответ на | UPDATE SET (a,b,c) = (SELECT ...) versus rules (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules
|
Список | pgsql-hackers |
On Sat, Jun 14, 2014 at 03:35:33PM -0400, Tom Lane wrote: > The best that I think is reasonable to do in such cases is to pull out > a separate copy of the sub-select for each actual NEW reference in a > rule query. So the example above would give rise to an expanded > rule query along the lines of > > INSERT INTO foolog VALUES ( (SELECT x as a, y as b, ...).a, > (SELECT x as a, y as b, ...).b, > ... ); Would it not be possible to use WITH here, like: WITH bar AS ( ... subselect ... ) INSERT INTO foolog VALUES (bar.a, bar.b, ...) Or am I missing something? Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > He who writes carelessly confesses thereby at the very outset that he does > not attach much importance to his own thoughts. -- Arthur Schopenhauer
В списке pgsql-hackers по дате отправления: