Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, cg@osss.net, pgsql-bugs@postgresql.org
Date: 2014-10-29T02:52:53Z
Lists: pgsql-bugs
On Wed, Oct 29, 2014 at 8:52 AM, Andres Freund <andres@2ndquadrant.com> wrote: > On 2014-10-28 19:28:05 -0400, Tom Lane wrote: >> I wrote: >> > I think that a better answer is to continue to do this update >> > nontransactionally, but to not let the code clear relhasindex etc >> > if we're inside a transaction block. It is certainly safe to put >> > off clearing those flags if we're not sure that we're seeing a >> > committed state of the table's schema. >> >> Attached is a proposed patch to do it that way. I borrowed Michael's >> test case. > > I still think it'd be better to use a transactional update. But I also > *do* agree that this is the safer way forward for now. So +1 from me. A transactional update would be better thinking long-term (ANALYZE is still transactional), but well this fix makes it as well. So no loud complains here and let's go with what is proposed. Regards, -- Michael