postgresql/src/include
Michael Paquier 28bbf7a81b 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 10:01:09 +09:00
..
access Use full 64-bit XID for checking if a deleted GiST page is old enough. 2019-07-24 20:25:22 +03:00
bootstrap Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
catalog Install dependencies to prevent dropping partition key columns. 2019-07-22 14:55:23 -04:00
commands Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
common Update unicode_norm_table.h to Unicode 12.1.0 2019-06-24 22:50:56 +02:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
fe_utils Fix typos in various places 2019-06-03 13:44:03 +09:00
foreign Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
jit Fix duplicated words in comments 2019-05-14 09:37:35 +09:00
lib Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
libpq Switch position of some declarations in libpq.h 2019-06-09 11:33:52 +09:00
mb Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
nodes Fix handling of expressions and predicates in REINDEX CONCURRENTLY 2019-07-29 10:01:09 +09:00
optimizer Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
parser Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
partitioning Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
port Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Mark ReplicationSlotCtl as PGDLLIMPORT. 2019-06-13 10:53:34 -04:00
rewrite Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rework examine_opclause_expression to use varonleft 2019-07-20 16:34:58 +02:00
storage Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
tcop Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Use full 64-bit XID for checking if a deleted GiST page is old enough. 2019-07-24 20:25:22 +03:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
fmgr.h Fix double-word typos 2019-06-13 10:03:56 -04:00
funcapi.h Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
getaddrinfo.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
getopt_long.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pg_config.h.in Remove remaining traces of Rand_OpenSSL() from the tree 2019-06-27 08:25:26 +09:00
pg_config.h.win32 Stamp 12beta2. 2019-06-17 17:12:29 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtar.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtime.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
port.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
postgres.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00