Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHuJs-0002gb-LL for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jul 2015 13:44:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHuJs-0003wo-6F for pgsql-bugs@arkaria.postgresql.org; Wed, 22 Jul 2015 13:44:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZHuJr-0003wV-Pg for pgsql-bugs@postgresql.org; Wed, 22 Jul 2015 13:44:23 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZHuJo-0008I8-Q6 for pgsql-bugs@postgresql.org; Wed, 22 Jul 2015 13:44:22 +0000 Received: from intern.anarazel.de (p5DDC6ED2.dip0.t-ipconnect.de [93.220.110.210]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id D7BCB860001; Wed, 22 Jul 2015 15:44:18 +0200 (CEST) Date: Wed, 22 Jul 2015 15:44:18 +0200 From: Andres Freund To: Tom Lane Cc: Piergiorgio Buongiovanni , pgsql-bugs@postgresql.org Subject: Re: BUG #13513: Turning a table into a view Message-ID: <20150722134418.GG19573@alap3.anarazel.de> References: <20150722082538.9705.21746@wrigleys.postgresql.org> <20150722085906.GE5053@awork2.anarazel.de> <416591758.338151.1437558796979.JavaMail.zimbra@net-international.com> <20150722101619.GF5053@awork2.anarazel.de> <17598.1437572535@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17598.1437572535@sss.pgh.pa.us> X-Pg-Spam-Score: -5.4 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2015-07-22 09:42:15 -0400, Tom Lane wrote: > Andres Freund 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs