pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML
Date: Tue, 04 Nov 2025 11:20:38 -0800
Message-ID: <81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com> (raw)
In-Reply-To: <650759.1762280552@sss.pgh.pa.us>
References: <bf4d04eecf4fe9830ce2674c3644b405ad978aa0.camel@j-davis.com>
	<650759.1762280552@sss.pgh.pa.us>

On Tue, 2025-11-04 at 13:22 -0500, Tom Lane wrote:
> Hmm ... ideally we'd throw an error for that.  CheckTableNotInUse()
> intends to prevent some similar cases, but it misses this one because
> ALTER TABLE is the outermost command and there's no check performed
> at the inner UPDATE.  Not sure how hard we need to work at preventing
> people from shooting themselves in the foot, though.

I poked around at a few ideas and they seemed to get invasive. Perhaps
the cure is worse than the disease, unless someone has an idea.

Regards,
	Jeff Davis






view thread (3+ messages)

Message-ID: <81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com>
Permalink:  ../81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com/
Also on:    postgresql.org/message-id/81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com

 · 

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-bugs@postgresql.org
  Cc: pgsql@j-davis.com, tgl@sss.pgh.pa.us
  Subject: Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML
  In-Reply-To: <81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com>

* 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