Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML
Date: 2025-11-04 19:20:38
Message-ID: 81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Korotkov 2025-11-04 23:41:13 Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown
Previous Message Tom Lane 2025-11-04 18:22:32 Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML