Re: BUG #13513: Turning a table into a view

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Piergiorgio Buongiovanni <p(dot)buongiovanni(at)net-international(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13513: Turning a table into a view
Date: 2015-07-22 13:44:18
Message-ID: 20150722134418.GG19573@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2015-07-22 09:42:15 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message b.yordanov2 2015-07-22 14:39:33 BUG #13514: PostgreSQL backend process crashes on jsonb_object_agg()
Previous Message Tom Lane 2015-07-22 13:42:15 Re: BUG #13513: Turning a table into a view