postgresql/src/backend
Alvaro Herrera 897795240c Enable CHECK constraints to be declared NOT VALID
This means that they can initially be added to a large existing table
without checking its initial contents, but new tuples must comply to
them; a separate pass invoked by ALTER TABLE / VALIDATE can verify
existing data and ensure it complies with the constraint, at which point
it is marked validated and becomes a normal part of the table ecosystem.

An non-validated CHECK constraint is ignored in the planner for
constraint_exclusion purposes; when validated, cached plans are
recomputed so that partitioning starts working right away.

This patch also enables domains to have unvalidated CHECK constraints
attached to them as well by way of ALTER DOMAIN / ADD CONSTRAINT / NOT
VALID, which can later be validated with ALTER DOMAIN / VALIDATE
CONSTRAINT.

Thanks to Thom Brown, Dean Rasheed and Jaime Casanova for the various
reviews, and Robert Hass for documentation wording improvement
suggestions.

This patch was sponsored by Enova Financial.
2011-06-30 11:24:31 -04:00
..
access Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
bootstrap Capitalization fixes 2011-06-19 00:37:30 +03:00
catalog Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
commands Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
executor Move the PredicateLockRelation() call from nodeSeqscan.c to heapam.c. It's 2011-06-29 21:57:43 +03:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Modernise pg_hba.conf token processing 2011-06-28 15:57:24 -04:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Avoid compiler warnings due to possibly unused variables 2011-06-16 23:43:56 +03:00
optimizer Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
parser Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
po Fixed string in German translation that causes segfault. 2011-06-20 13:53:15 +02:00
port Capitalization fixes 2011-06-19 00:37:30 +03:00
postmaster Unify spelling of "canceled", "canceling", "cancellation" 2011-06-29 09:28:46 +03:00
regex Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
replication Add missing -I switch for VPATH builds. 2011-06-22 13:20:03 -04:00
rewrite Add a missing_ok argument to get_object_address(). 2011-06-27 21:19:31 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Unify spelling of "canceled", "canceling", "cancellation" 2011-06-29 09:28:46 +03:00
tcop Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
tsearch Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
utils Enable CHECK constraints to be declared NOT VALID 2011-06-30 11:24:31 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
Makefile Fix symlink for errcodes.h so it works in VPATH builds from tarballs. 2011-06-22 13:08:08 -04:00
nls.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00