Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML - Mailing list pgsql-bugs

From Jeff Davis
Subject Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML
Date
Msg-id 81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com
Whole thread Raw
In response to Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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




pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML
Next
From: Alexander Korotkov
Date:
Subject: Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown