- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit479ebce
committed
doc: mention unusability of dropped CHECK to verify NOT NULL
It's possible to use a CHECK (col IS NOT NULL) constraint to skipscanning a table for nulls when adding a NOT NULL constraint on the samecolumn. However, if the CHECK constraint is dropped on the same commandthat the NOT NULL is added, this fails, i.e., makes the NOT NULL additionslow. The best we can do about it at this stage is to document this sothat users aren't taken by surprise.(In Postgres 18 you can directly add the NOT NULL constraint as NOTVALID instead, so there's no longer much use for the CHECK constraint,therefore no point in building mechanism to support the case better.)Reported-by: Andrew <psy2000usa@yahoo.com>Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>Discussion:https://postgr.es/m/175385113607.786.16774570234342968908@wrigleys.postgresql.org1 parent1d3ded5 commit479ebce
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
0 commit comments
Comments
(0)