diff options
author | Thomas Munro <tmunro@postgresql.org> | 2020-11-02 19:50:45 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2020-11-03 01:19:50 +1300 |
commit | 257836a75585934cc05ed7a80bccf8190d41e056 (patch) | |
tree | 5f3eb018d0f0609063669b81136036b79bf8f948 /src/backend/utils/cache/relcache.c | |
parent | cd6f479e79f3a33ef7a919c6b6c0c498c790f154 (diff) | |
download | postgresql-257836a75585934cc05ed7a80bccf8190d41e056.tar.gz postgresql-257836a75585934cc05ed7a80bccf8190d41e056.zip |
Track collation versions for indexes.
Record the current version of dependent collations in pg_depend when
creating or rebuilding an index. When accessing the index later, warn
that the index may be corrupted if the current version doesn't match.
Thanks to Douglas Doole, Peter Eisentraut, Christoph Berg, Laurenz Albe,
Michael Paquier, Robert Haas, Tom Lane and others for very helpful
discussion.
Author: Thomas Munro <thomas.munro@gmail.com>
Author: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Peter Eisentraut <peter.eisentraut@2ndquadrant.com> (earlier versions)
Discussion: https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 9224e2ffeda..66393becfb6 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -42,6 +42,7 @@ #include "access/xact.h" #include "access/xlog.h" #include "catalog/catalog.h" +#include "catalog/index.h" #include "catalog/indexing.h" #include "catalog/namespace.h" #include "catalog/partition.h" @@ -5934,6 +5935,7 @@ load_relcache_init_file(bool shared) rel->rd_idattr = NULL; rel->rd_pubactions = NULL; rel->rd_statvalid = false; + rel->rd_version_checked = false; rel->rd_statlist = NIL; rel->rd_fkeyvalid = false; rel->rd_fkeylist = NIL; |