postgresql/src/include/nodes
Michael Paquier 7cce159349 Fix handling of expressions and predicates in REINDEX CONCURRENTLY
When copying the definition of an index rebuilt concurrently for the new
entry, the index information was taken directly from the old index using
the relation cache.  In this case, predicates and expressions have
some post-processing to prepare things for the planner, which loses some
information including the collations added in any of them.

This inconsistency can cause issues when attempting for example a table
rewrite, and makes the new indexes rebuilt concurrently inconsistent
with the old entries.

In order to fix the problem, fetch expressions and predicates directly
from the catalog of the old entry, and fill in IndexInfo for the new
index with that.  This makes the process more consistent with
DefineIndex(), and the code is refactored with the addition of a routine
to create an IndexInfo node.

Reported-by: Manuel Rigger
Author: Michael Paquier
Discussion: https://postgr.es/m/CA+u7OA5Hp0ra235F3czPom_FyAd-3+XwSJmX95r1+sRPOJc9VQ@mail.gmail.com
Backpatch-through: 12
2019-07-29 09:58:49 +09:00
..
bitmapset.h Add support for multivariate MCV lists 2019-03-27 18:32:18 +01:00
execnodes.h Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
extensible.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
lockoptions.h Don't include heapam.h from others headers. 2019-01-14 16:24:41 -08:00
makefuncs.h Fix handling of expressions and predicates in REINDEX CONCURRENTLY 2019-07-29 09:58:49 +09:00
memnodes.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
nodeFuncs.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
nodes.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
params.h Refactor ParamListInfo initialization 2019-03-14 13:30:09 +01:00
parsenodes.h Reconcile nodes/*funcs.c with PostgreSQL 12 work. 2019-06-09 14:00:36 -07:00
pathnodes.h Speed up finding EquivalenceClasses for a given set of rels 2019-07-21 17:30:58 +12:00
pg_list.h Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
plannodes.h Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
primnodes.h Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
print.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
readfuncs.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
replnodes.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
supportnodes.h Allow extensions to generate lossy index conditions. 2019-02-11 21:26:14 -05:00
tidbitmap.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
value.h Update copyright for 2019 2019-01-02 12:44:25 -05:00