Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
Date: 2019-07-22 21:41:26
Message-ID: 20401.1563831686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> I have done some work on that, and for now I am finishing with the
> attached. This takes the approach of updating BuildIndexInfo() so as
> the optimizations for the planner are not done.

This seems like a really bad idea.

As you have it, whether the relcache contains optimized or unoptimized
expressions will be basically chance, depending on which sort of call
happened first after the last cache flush. That will break things,
because for most use-cases it's *not* optional to apply
eval_const_expressions.

Even without that, changing the APIs of the functions you've touched
here seems pretty invasive.

I think the correct fix is to nuke the code in REINDEX CONCURRENTLY that
thinks it should use any of this infrastructure to fetch the existing
index properties, and just have it read the catalog directly instead.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-07-23 04:28:38 Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
Previous Message Peter Eisentraut 2019-07-22 11:16:21 Re: Logging corruption error codes