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

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Date: 2025-11-04T19:20:38Z
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