Re: [HACKERS] contraints_exclusion fails to refute simple condition

2015-03-05 Thread Andrew Gierth
> "Sandro" == Sandro Santilli writes: Sandro> PostGIS installs standard constraints of this kind: Sandro> CHECK (geometrytype(g) = 'POINT'::text OR g IS NULL) If geometrytype() is strict, the IS NULL condition is superfluous. CHECK(x) _passes_ when x is null, rather than rejecting the r

[HACKERS] contraints_exclusion fails to refute simple condition

2015-03-05 Thread Sandro Santilli
PostGIS installs standard constraints of this kind: CHECK (geometrytype(g) = 'POINT'::text OR g IS NULL) The constraint is used by constraint_exclusion if using this condition: WHERE g IS NOT NULL AND geometrytype(g) = 'LINESTRING' But it is _NOT_ used if the NOT NULL condition is removed: