Re: PostgreSQL domains and NOT NULL constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, Erki Eessaar <erki(dot)eessaar(at)taltech(dot)ee>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL domains and NOT NULL constraint
Date: 2023-10-24 01:02:28
Message-ID: 461950.1698109348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> writes:
> On Mon, 23 Oct 2023, 19:34 Tom Lane, <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> After ruminating on this for awhile, here's a straw-man proposal:
>> ...

> How does this work w.r.t. concurrently created tables that contain the
> domain?

It wouldn't change that at all I think. I had noticed that we'd
probably need to tweak validateDomainConstraint() to ensure it applies
the same semantics that INSERT/UPDATE do --- although with Isaac's
idea to enable better tracking of which constraints will fail on NULL,
maybe just a blind application of the constraint expression will still
be close enough.

I agree that concurrent transactions can create violations of the new
constraint, but (a) that's true now, (b) I have no good ideas about
how to improve it, and (c) it seems like an independent problem.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2023-10-24 01:16:55 Re: run pgindent on a regular basis / scripted manner
Previous Message Jeff Davis 2023-10-24 00:50:52 Re: run pgindent on a regular basis / scripted manner