Re: Rules: A Modest Proposal
От | Tom Lane |
---|---|
Тема | Re: Rules: A Modest Proposal |
Дата | |
Msg-id | 7241.1254753173@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Rules: A Modest Proposal (Martijn van Oosterhout <kleptog@svana.org>) |
Ответы |
Re: Rules: A Modest Proposal
|
Список | pgsql-hackers |
Martijn van Oosterhout <kleptog@svana.org> writes: > ISTM it may be possible to use the new WITH construct here. So the rule > evaluation for the following >> create table t (a integer); >> create table t_log (a integer); >> create rule t_ins AS ON insert TO t do also insert into t_log values (NEW.a); >> insert into t values (floor(random()*1000)::integer); > becomes something like: > WITH NEW AS ( > insert into t values (floor(random()*1000)::integer); > RETURNING * > ) > insert into t_log values (NEW.a); > Would this not have the required semantics? Interesting idea, but it's not clear how to make it work with multiple DO ALSO rules, nor with conditional DO INSTEAD rules. regards, tom lane
В списке pgsql-hackers по дате отправления: