Re: Supporting MERGE on updatable views
От | Alvaro Herrera |
---|---|
Тема | Re: Supporting MERGE on updatable views |
Дата | |
Msg-id | 202401301158.twczkojapiun@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: Supporting MERGE on updatable views (Dean Rasheed <dean.a.rasheed@gmail.com>) |
Ответы |
Re: Supporting MERGE on updatable views
|
Список | pgsql-hackers |
On 2024-Jan-29, Dean Rasheed wrote: > Yeah, for all practical purposes, that check in CheckValidResultRel() > has been dead code since d751ba5235, but I think it's still worth > doing, and if we're going to do it, we should do it properly. I don't > like using elog() in some cases and ereport() in others, but I also > don't like having that much duplicated code between this and the > rewriter (and this patch doubles the size of that block). > > A neater solution is to export the rewriter functions and use them in > CheckValidResultRel(). All these checks can then be reduced to > > if (!view_has_instead_trigger(...)) > error_view_not_updatable(...) > > which eliminates a lot of duplicated code and means that we now have > just one place that throws these errors. This looks quite nice, thanks. LGTM. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "No me acuerdo, pero no es cierto. No es cierto, y si fuera cierto, no me acuerdo." (Augusto Pinochet a una corte de justicia)
В списке pgsql-hackers по дате отправления: