Re: Problem Observed in behavior of Create Index Concurrently and Hot Update

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila@huawei.com>, pgsql-hackers@postgresql.org
Date: 2012-11-27T17:50:36Z
Lists: pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> So the idea would be to skip about-to-be-dropped indexes in
> RelationGetIndexList directly - we don't ever need to watch those, not
> even for HOT - because we only have the necessary knowledge there. The
> normal valid/ready checks will be done at the callsites of
> RelationGetIndexList(). But those checks can be done in a locked manner
> now.

Right.

> Are you already working on a fix? Or shall I work on an updated patch?

I'll work on it.

> I vote for introducing wrapper functions/macro to do the
> about-to-be-dropped check, its hard enough to understand as-is.

Meh.  If it's only going to be done in RelationGetIndexList, I'm
not sure that a wrapper macro is worth the trouble.  If we needed
the test in multiple places I'd agree, but what other spots do you
see?

			regards, tom lane