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)