pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Alberto Piai <alberto.piai@gmail.com>
To: pgsql-hackers@postgresql.org
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Subject: Re: Adding a stored generated column without long-lived locks
Date: Sat, 29 Aug 2026 08:14:45 +0200
Message-ID: <82554bb40f6822bebbda7fcbc5ec1dc6a1823c0d.camel@cybertec.at> (raw)
In-Reply-To: <DL0PFQ4CM3KO.38HQUI04TKPLT@gmail.com>
References: <DJOPT622HYJK.3JRH1VQCV5CDL@gmail.com>
	<2eb68e74ea95fc2f691de7d8cd28448d00d1d216.camel@cybertec.at>
	<DJUGET7QLNRK.7G2H4M2PPJM9@gmail.com>
	<79b63e772179abb4f5ad749d9e067d48a5537599.camel@cybertec.at>
	<DKHUPZ08JV6G.2938OV580K72C@gmail.com>
	<6f5ea02f6e5205a96a9b3979190a4d7cb3c99414.camel@cybertec.at>
	<DKXFEG915LK8.12HECZQW2OWQE@gmail.com>
	<86a9336dc25d9a085916ad247a5791dc53d2ab13.camel@cybertec.at>
	<DKY5OJ1NSSGO.3U2FKRKCHM533@gmail.com>
	<57bd5c0e2b532c07a1e6cd867520e899b1007622.camel@cybertec.at>
	<DL0C8TG99HCO.1XVPKG2IM0C1S@gmail.com>
	<31fec16020bdf25d4a62cbbb4b8ea00af007e0d9.camel@cybertec.at>
	<DL0PFQ4CM3KO.38HQUI04TKPLT@gmail.com>

On Fri, 2026-08-28 at 18:07 +0200, Alberto Piai wrote:
> Before this gets eventually picked up by a committer: I am having second
> thoughts about my choice to allow = in addition to IS NOT DISTINCT FROM.
> 
> The patch can absolutely be reviewed with that in mind, I think.
> Removing support for = would be an isolated change which wouldn't affect
> the rest of the implementation.
> 
> As it stands, I'd probably prefer it committed without that, and expand
> on the first commit at a later point.
> 
> Anyway I'll try to find time to think about a more convincing proof (or
> a counterexample) over the next couple of days.

I think I see what you mean: this command exists exclusively so that users
can add a generated column to a bigger table without downtime.  So they
will create the constraint specifically for this purpose, and it wouldn't
be a loss of functionality to force them to use IS NOT DISTINCT FROM.
Removing support for a constraint with = would simplify the code and the
documentation.

I won't object to that, but I like the patch as it is now.
I can imagine a case where somebody uses a regular column with a check
constraint and at some later point decides to turn the column into a
generated column.  That user might be annoyed if they had to create a
second check constraint, since there already is a perfectly good one.

I'd say that if you remove support for =, you might as well also remove
support for check constraints in the shape "(expression IS NOT DISTINCT
FROM column)".

Yours,
Laurenz Albe






view thread (41+ messages)  latest in thread

Message-ID: <82554bb40f6822bebbda7fcbc5ec1dc6a1823c0d.camel@cybertec.at>
Permalink:  ../82554bb40f6822bebbda7fcbc5ec1dc6a1823c0d.camel@cybertec.at/
Also on:    postgresql.org/message-id/82554bb40f6822bebbda7fcbc5ec1dc6a1823c0d.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: laurenz.albe@cybertec.at, alberto.piai@gmail.com, alvherre@kurilemu.de
  Subject: Re: Adding a stored generated column without long-lived locks
  In-Reply-To: <82554bb40f6822bebbda7fcbc5ec1dc6a1823c0d.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox