Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XeHuo-0007De-8e for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Oct 2014 06:18:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XeHun-0004KR-Or for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Oct 2014 06:18:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XeHul-0004K7-Nt for pgsql-bugs@postgresql.org; Wed, 15 Oct 2014 06:18:27 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XeHud-0000aj-Qi for pgsql-bugs@postgresql.org; Wed, 15 Oct 2014 06:18:25 +0000 Received: from intern.anarazel.de (092-111-191-154.static.chello.nl [92.111.191.154]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 4E4B7E3283; Wed, 15 Oct 2014 08:18:18 +0200 (CEST) Date: Wed, 15 Oct 2014 08:18:15 +0200 From: Andres Freund To: Michael Paquier Cc: cg@osss.net, pgsql-bugs@postgresql.org Subject: Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done Message-ID: <20141015061815.GF7242@alap3.anarazel.de> References: <20141010181433.25463.5856@wrigleys.postgresql.org> <20141010191401.GA18020@awork2.anarazel.de> <20141015051254.GC7242@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) 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 2014-10-15 15:02:43 +0900, Michael Paquier wrote: > On Wed, Oct 15, 2014 at 2:12 PM, Andres Freund > wrote: > > > I'm not sure which danger you're seeing here. Imo we need to choose > > between heap_inplace/heap_update for VACUUM/ANALYZE because one is > > allowed to run in a transaction, and the other is not. It simply *can't* > > be safe for ANALYZE to set things like relhastriggers = false using > > heap_inplace(). > > There's problems with both it rolling back and thus undoing the action > > that allowed relhastriggers = false to be set and scenarios where it's > > not ok that other backends can see that value before the transaction > > committed. > > Hm, I was wondering about the potential effects of VACUUM FULL or VACUUM > ANALYZE, but as they cannot run in a tx block... Also they all take ShareUpdateExclusive locks preventing them from running concurrently. > Btw, I have just put my hands on this code and made the attached to > make vac_update_relstats able to do a transactional update. It looks > to work fine with only a check on the flags of vacuum statement. Have you tested that the problem's now fixed? Imo this is complex enough to deserve a regression test. Can you add one? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs