- Notifications
You must be signed in to change notification settings - Fork5
Commit8977952
committed
Enable CHECK constraints to be declared NOT VALID
This means that they can initially be added to a large existing tablewithout checking its initial contents, but new tuples must comply tothem; a separate pass invoked by ALTER TABLE / VALIDATE can verifyexisting data and ensure it complies with the constraint, at which pointit is marked validated and becomes a normal part of the table ecosystem.An non-validated CHECK constraint is ignored in the planner forconstraint_exclusion purposes; when validated, cached plans arerecomputed so that partitioning starts working right away.This patch also enables domains to have unvalidated CHECK constraintsattached to them as well by way of ALTER DOMAIN / ADD CONSTRAINT / NOTVALID, which can later be validated with ALTER DOMAIN / VALIDATECONSTRAINT.Thanks to Thom Brown, Dean Rasheed and Jaime Casanova for the variousreviews, and Robert Hass for documentation wording improvementsuggestions.This patch was sponsored by Enova Financial.1 parentb36927f commit8977952
File tree
19 files changed
+581
-70
lines changed- doc/src/sgml
- ref
- src
- backend
- access/common
- catalog
- commands
- optimizer/util
- parser
- tcop
- utils/cache
- include
- access
- catalog
- commands
- nodes
- test/regress
- expected
- sql
19 files changed
+581
-70
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1899 | 1899 |
| |
1900 | 1900 |
| |
1901 | 1901 |
| |
1902 |
| - | |
| 1902 | + | |
1903 | 1903 |
| |
1904 | 1904 |
| |
1905 | 1905 |
| |
|
Lines changed: 38 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
| 31 | + | |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
34 | 36 |
| |
35 | 37 |
| |
36 | 38 |
| |
| |||
70 | 72 |
| |
71 | 73 |
| |
72 | 74 |
| |
73 |
| - | |
| 75 | + | |
74 | 76 |
| |
75 | 77 |
| |
76 | 78 |
| |
77 | 79 |
| |
78 |
| - | |
79 |
| - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 |
| |
81 | 89 |
| |
82 | 90 |
| |
| |||
90 | 98 |
| |
91 | 99 |
| |
92 | 100 |
| |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
93 | 112 |
| |
94 | 113 |
| |
95 | 114 |
| |
| |||
155 | 174 |
| |
156 | 175 |
| |
157 | 176 |
| |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
158 | 187 |
| |
159 | 188 |
| |
160 | 189 |
| |
| |||
250 | 279 |
| |
251 | 280 |
| |
252 | 281 |
| |
253 |
| - | |
254 |
| - | |
255 |
| - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
256 | 287 |
| |
257 | 288 |
| |
258 | 289 |
| |
|
Lines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
243 |
| - | |
| 243 | + | |
244 | 244 |
| |
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
248 |
| - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
249 | 251 |
| |
250 | 252 |
| |
251 | 253 |
| |
| |||
308 | 310 |
| |
309 | 311 |
| |
310 | 312 |
| |
311 |
| - | |
| 313 | + | |
312 | 314 |
| |
313 |
| - | |
314 |
| - | |
| 315 | + | |
| 316 | + | |
315 | 317 |
| |
316 | 318 |
| |
317 | 319 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
| 203 | + | |
203 | 204 |
| |
204 | 205 |
| |
205 | 206 |
| |
|
Lines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
| 101 | + | |
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| |||
1846 | 1846 |
| |
1847 | 1847 |
| |
1848 | 1848 |
| |
1849 |
| - | |
| 1849 | + | |
1850 | 1850 |
| |
1851 | 1851 |
| |
1852 | 1852 |
| |
| |||
1907 | 1907 |
| |
1908 | 1908 |
| |
1909 | 1909 |
| |
1910 |
| - | |
| 1910 | + | |
1911 | 1911 |
| |
1912 | 1912 |
| |
1913 | 1913 |
| |
| |||
1967 | 1967 |
| |
1968 | 1968 |
| |
1969 | 1969 |
| |
1970 |
| - | |
| 1970 | + | |
1971 | 1971 |
| |
1972 | 1972 |
| |
1973 | 1973 |
| |
| |||
2081 | 2081 |
| |
2082 | 2082 |
| |
2083 | 2083 |
| |
| 2084 | + | |
2084 | 2085 |
| |
2085 | 2086 |
| |
2086 | 2087 |
| |
| |||
2194 | 2195 |
| |
2195 | 2196 |
| |
2196 | 2197 |
| |
2197 |
| - | |
| 2198 | + | |
| 2199 | + | |
2198 | 2200 |
| |
2199 | 2201 |
| |
2200 | 2202 |
| |
| |||
2203 | 2205 |
| |
2204 | 2206 |
| |
2205 | 2207 |
| |
| 2208 | + | |
2206 | 2209 |
| |
2207 | 2210 |
| |
2208 | 2211 |
| |
|
0 commit comments
Comments
(0)