Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules
Дата
Msg-id 539CE857.3030103@nasby.net
обсуждение исходный текст
Ответ на Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules
Список pgsql-hackers
On 6/14/14, 3:51 PM, Andres Freund wrote:
>> Hm.  But you might as well use a trigger, no?  Is anyone likely to
>> >actually be doing such a thing?
> I don't think anybody is likely to do such a thing on an actual table,
> but INSTEAD OF for views is pretty new. For a long time rules were the
> the only way to implement updatable views (including any form of row
> level security).
>
>> >It's conceivable that we could optimize the special case of NEW.*,
>> >especially if it appears in the rule query's targetlist.  But it's
>> >trouble I don't really care to undertake ...
> I think it's fine to just throw an error.

If there was a showstopper to moving forward with rule support I think it'd be OK to throw our hands in the air, but
that'snot the case here.
 

I'm in favor of doing the substitution, just like we do today with RULES, warts and all. We already warn people against
usingrules and that they're very difficult to get correct, so I don't think double eval of an expression should
surpriseanyone.
 
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



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

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: delta relations in AFTER triggers
Следующее
От: Andres Freund
Дата:
Сообщение: Re: UPDATE SET (a,b,c) = (SELECT ...) versus rules