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