From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
Date: Mon, 22 Jul 2019 17:41:26 -0400
Message-ID: <20401.1563831686@sss.pgh.pa.us> (raw)
In-Reply-To: <20190718042543.GE1416@paquier.xyz>
References: <CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com>
<20190718030232.GD1416@paquier.xyz>
<20190718042543.GE1416@paquier.xyz>
Michael Paquier <michael@paquier.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, rigger.manuel@gmail.com
Subject: Re: REINDEX CONCURRENTLY causes ALTER TABLE to fail
In-Reply-To: <20401.1563831686@sss.pgh.pa.us>
References: <CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com> <20190718030232.GD1416@paquier.xyz> <20190718042543.GE1416@paquier.xyz> <20401.1563831686@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox