On 2015-07-22 09:42:15 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > You can probably work around the problem by inserting a VACUUM
> > tbl_becoming_view; before the CREATE RULE. IIRC that should "recompute"
> > relhastriggers.
>
> Dunno, I think vacuum does update relhasindexes, but there would be no
> reason for it to think about relhastriggers.
I still didn't test, but there appears to be code for relhastriggers:
void
vac_update_relstats(Relation relation,
BlockNumber num_pages, double num_tuples,
BlockNumber num_all_visible_pages,
bool hasindex, TransactionId frozenxid,
MultiXactId minmulti,
bool in_outer_xact)
{
...
if (pgcform->relhastriggers && relation->trigdesc == NULL)
{
pgcform->relhastriggers = false;
dirty = true;
}
Andres