postgresql/src/backend/commands
Michael Paquier 61d7c7bce3 Prevent reindex of invalid indexes on TOAST tables
Such indexes can only be duplicated leftovers of a previously failed
REINDEX CONCURRENTLY command, and a valid equivalent is guaranteed to
exist.  As toast indexes can only be dropped if invalid, reindexing
these would lead to useless duplicated indexes that can't be dropped
anymore, except if the parent relation is dropped.

Thanks to Justin Pryzby for reminding that this problem was reported
long ago during the review of the original patch of REINDEX
CONCURRENTLY, but the issue was never addressed.

Reported-by: Sergei Kornilov, Justin Pryzby
Author: Julien Rouhaud
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net
Discussion: https://postgr.es/m/20200216190835.GA21832@telsasoft.com
Backpatch-through: 12
2020-03-10 15:38:17 +09:00
..
aggregatecmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
alter.c Fix priv checks for ALTER <object> DEPENDS ON EXTENSION 2020-02-10 11:47:09 -03:00
amcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
analyze.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
async.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
cluster.c Update obsolete comment. 2020-02-15 15:22:40 -05:00
collationcmds.c Remove excess parens in ereport() calls 2020-01-30 13:32:04 -03:00
comment.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
constraint.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
conversioncmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
copy.c Optimize update of tables with generated columns 2020-02-17 15:20:58 +01:00
createas.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
dbcommands.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
define.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
discard.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dropcmds.c Revert "Forbid DROP SCHEMA on temporary namespaces" 2020-01-08 10:36:12 +09:00
event_trigger.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
explain.c Fix handling of "Subplans Removed" field in EXPLAIN output. 2020-02-04 13:07:13 -05:00
extension.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
foreigncmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
functioncmds.c Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
indexcmds.c Prevent reindex of invalid indexes on TOAST tables 2020-03-10 15:38:17 +09:00
lockcmds.c Make inherited LOCK TABLE perform access permission checks on parent table only. 2020-02-18 13:13:15 +09:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
matview.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
opclasscmds.c Add equalimage B-Tree support functions. 2020-02-26 11:28:25 -08:00
operatorcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
policy.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
portalcmds.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
prepare.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
proclang.c Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
publicationcmds.c Remove excess parens in ereport() calls 2020-01-30 13:32:04 -03:00
schemacmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
seclabel.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sequence.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statscmds.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
subscriptioncmds.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
tablecmds.c Code simplification 2020-03-09 09:34:55 +01:00
tablespace.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
trigger.c Add tg_updatedcols to TriggerData 2020-03-09 09:34:55 +01:00
tsearchcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
typecmds.c Allow ALTER TYPE to change some properties of a base type. 2020-03-06 12:19:29 -05:00
user.c Remove long-dead comments. 2020-02-12 14:33:49 -05:00
vacuum.c Allow vacuum command to process indexes in parallel. 2020-01-20 07:57:49 +05:30
variable.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
view.c Restructure ALTER TABLE execution to fix assorted bugs. 2020-01-15 18:49:24 -05:00