Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: jbe-mlist(at)magnetkern(dot)de, PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)
Date: 2025-01-08 21:24:34
Message-ID: 1694911.1736371474@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> I think this needs some serious research.

We've discussed this topic before. The spec's definition of IS [NOT]
NULL for composite values is bizarre to say the least. I think
there's been an intentional choice to keep most NOT NULL checks
"simple", that is we look at the overall value's isnull bit and
don't probe any deeper than that.

If the optimizations added in v17 changed existing behavior,
I agree that's bad. We should probably fix it so that those
are only applied when argisrow is false.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2025-01-08 23:09:47 Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)
Previous Message Bruce Momjian 2025-01-08 21:10:42 Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2025-01-08 21:25:15 Re: Sample rate added to pg_stat_statements
Previous Message Bruce Momjian 2025-01-08 21:10:42 Re: Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)