postgresql/src/include
Tom Lane 1da5bef317 Fix assorted bugs in CREATE INDEX CONCURRENTLY.
This patch changes CREATE INDEX CONCURRENTLY so that the pg_index
flag changes it makes without exclusive lock on the index are made via
heap_inplace_update() rather than a normal transactional update.  The
latter is not very safe because moving the pg_index tuple could result in
concurrent SnapshotNow scans finding it twice or not at all, thus possibly
resulting in index corruption.

In addition, fix various places in the code that ought to check to make
sure that the indexes they are manipulating are valid and/or ready as
appropriate.  These represent bugs that have existed since 8.2, since
a failed CREATE INDEX CONCURRENTLY could leave a corrupt or invalid
index behind, and we ought not try to do anything that might fail with
such an index.

Also fix RelationReloadIndexInfo to ensure it copies all the pg_index
columns that are allowed to change after initial creation.  Previously we
could have been left with stale values of some fields in an index relcache
entry.  It's not clear whether this actually had any user-visible
consequences, but it's at least a bug waiting to happen.

This is a subset of a patch already applied in 9.2 and HEAD.  Back-patch
into all earlier supported branches.

Tom Lane and Andres Freund
2012-11-29 14:51:46 -05:00
..
access Fix multiple problems in WAL replay. 2012-11-12 22:05:21 -05:00
bootstrap Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
catalog Fix assorted bugs in CREATE INDEX CONCURRENTLY. 2012-11-29 14:51:46 -05:00
commands Fix ALTER EXTENSION / SET SCHEMA 2012-10-31 10:49:14 -03:00
executor Install defenses against overflow in BuildTupleHashTable(). 2011-05-23 12:52:46 -04:00
foreign pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
lib Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
libpq Remove arbitrary limitation on length of common name in SSL certificates. 2012-02-23 15:48:09 -05:00
mb Back-patch addition of pg_wchar-to-multibyte conversion functionality. 2012-07-10 16:53:27 -04:00
nodes Fix handling of inherited check constraints in ALTER COLUMN TYPE. 2012-11-05 13:36:26 -05:00
optimizer Fix SELECT DISTINCT with index-optimized MIN/MAX on inheritance trees. 2012-11-26 12:58:20 -05:00
parser Fix handling of collations in multi-row VALUES constructs. 2011-04-18 15:31:52 -04:00
port Revert "Force use of "%I64d" format for 64 bit ints on MinGW." 2011-04-27 14:55:18 -04:00
portability Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postmaster Improve coding around the fsync request queue. 2012-07-17 16:57:22 -04:00
regex Back-patch fix for extraction of fixed prefixes from regular expressions. 2012-07-10 18:00:44 -04:00
replication Back-patch assorted latch-related fixes. 2011-08-10 12:20:45 -04:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:44:03 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Close un-owned SMgrRelations at transaction end. 2012-10-17 12:38:33 -04:00
tcop Revise the API for GUC variable assign hooks. 2011-04-07 00:12:02 -04:00
tsearch pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
utils Back-patch fix for extraction of fixed prefixes from regular expressions. 2012-07-10 18:00:44 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
fmgr.h Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
funcapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getaddrinfo.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
getopt_long.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:54:50 +02:00
miscadmin.h Do stack-depth checking in all postmaster children. 2012-04-08 19:08:13 +03:00
pg_config.h.in Make configure probe for mbstowcs_l as well as wcstombs_l. 2012-08-31 14:18:08 -04:00
pg_config.h.win32 Stamp 9.1.6. 2012-09-19 17:50:31 -04:00
pg_config_manual.h Revert accidental change to pg_config_manual.h. 2011-10-09 22:23:30 -04:00
pg_trace.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
pgstat.h Fix VACUUM so that it always updates pg_class.reltuples/relpages. 2011-05-30 17:06:52 -04:00
pgtime.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
port.h setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:10:23 +03:00
postgres.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
rusagestub.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
windowapi.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00