Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, cg(at)osss(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11638: Transaction safety fails when constraints are dropped and analyze is done
Date: 2014-10-29 02:52:53
Message-ID: CAB7nPqS4wsPGx2y6GqKXVBPNeWaA_Mkk4+jpWwWn9EhBk5e4_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Oct 29, 2014 at 8:52 AM, Andres Freund <andres(at)2ndquadrant(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-10-29 03:23:46 Re: [GENERAL] Need guidance on regression.diffs
Previous Message Michael Paquier 2014-10-29 02:39:26 Re: BUG #11807: Postgresql server crashed when running transaction tests