Re: Not Null Constraint vs Query Planning

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Don Seiler <don(at)seiler(dot)us>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Not Null Constraint vs Query Planning
Date: 2020-03-02 18:30:22
Message-ID: 85a9f663-a198-9fe2-96d3-6e2d5d74b22c@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/03/2020 18:09, Don Seiler wrote:
> The REAL reason for this is that I'm wondering if I created a NOT NULL
> check constraint with "NOT VALID" would that then NOT be considered in such
> a "short-circuit" case until I ran the VALIDATE CONSTRAINT on it? Perhaps I
> should have just asked this in its own thread but I started diving into the
> query plan thing.

You cannot do this because NOT NULL isn't a real constraint (meaning it
does not appear in pg_constraint). There have been several attempts to
make it a real constraint over the years but so far nothing has come of
them.
--
Vik Fearing

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stan 2020-03-02 18:59:04 Detecting which columns a query will modify in a function called by a trigger
Previous Message Don Seiler 2020-03-02 17:09:58 Not Null Constraint vs Query Planning