Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGMaF-00DLG5-QL for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Nov 2025 19:20:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vGMaD-00GFcP-Fu for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Nov 2025 19:20:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1vGMaD-00GFcF-2e for pgsql-bugs@lists.postgresql.org; Tue, 04 Nov 2025 19:20:44 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vGMa9-005z35-27 for pgsql-bugs@postgresql.org; Tue, 04 Nov 2025 19:20:43 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-29516a36affso45115445ad.3 for ; Tue, 04 Nov 2025 11:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1762284039; x=1762888839; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=TQ3Zzvbd47jFIAcXZmYpIi8WoJvs6NjuWZahPvwWRO0=; b=kpebN++SGKpwuHzQvOXqbMiT/x2orbWC0Ycp9IJv4hLMAP3Rqcsk21IwrqCi4A4in8 AFmvKB+sLhHZ4tyLFOSjXctG30TGfTaogaO891SBfnLejN7+uC37oAf8cH7x/lNeM3SA JyHv2FHssdkL0nbbhkNUP74W6HSPlpP1l0XjzQ4JQu12GlfJyxdBBnMWnckC798Nu22s lCMmmiWO8Xy49X7uFQyKuV7UC13xoyhYxHlfaBVvYw6ka9zY1BslDYkfkGBJWFmp4HZy aGhx4WSuqlkEneAl4RSTH833jupNOKKqPKuVgPbIiMpRKvotxn/yJ1ZMCVshEagDIVVP EMng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762284039; x=1762888839; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TQ3Zzvbd47jFIAcXZmYpIi8WoJvs6NjuWZahPvwWRO0=; b=LN1woGZAaNtmU2Ar+nR7njf3HSiQL3CcId2mMi0EGyLZF9c6IZF0h5WQtnmZ04Sr0s 7+Wpw/ayhY9B/fIwp2fQvm+7uXHGxg/CLwaFkD9Jx9kdurq1VeofCMUsSNDag5FZog1/ tzG7DQTgDOIKAG3zlNrJxGM//6xUVNph256OcXkmM9GRX0jWMMzoc2GRjnDgeJOJLHF1 JZfahlCqff6LJ+o45UZ+O8BE0WZ96UhCbC5Z3PXH5R+UvA3M6Yf88kW6HIGI+ONH++ko +qcmB+SFVL2vRb60jfHwM+vbVaFl1267KCYl5B1nJ1WTRIK8XxhE8OpHwxZi3A/4p+OA KqHA== X-Gm-Message-State: AOJu0YwTC/X/myXINJ5r2feALAsykrZzBIHIJm9wcs8/X91bvhA0HRjf 7lLTFmACOXxC4n9OS1Hk6mnv+rJws4cPhkmnqusXM8j04ABBIptd2ITr5dWqZ7/Hc64lEHvT8WU L6UI= X-Gm-Gg: ASbGnctZV52dw5Ny9GvS+vWpTAr0mETX1fSTTC1EfdwzPz3YwULRlJFE9N6o4qX718t kNugW2rxBHbq8vHZc9FllcyO4Rut9xSPjUghE8fZuOwMaWqaLzbIHld7/l7PmAibysSWdmC31N9 QIk15nNqgBPFxjiXx6XyAVK2HyRAX8//dHdQlfMLtpjPm1bgDm+Z3/StlwJtie0sK0QooOI/pLX HKiBXjGq+wdeztpsCYwruBo5BoAc0VJOWP2UZwXzUsx29wlLQRivaihorV8ue36bVtNawkWhbON zXHFW6vuw8/nc22YWxDQVoAR0T5zmAktgaFljx9w1n0zsu68YX1XA0Vt03Dyqf3tcurEMI7P/6M +k1u9zy/wLKjJRsAkH+kiseIOLOUtk+5asUaxd9UB/CJElISj5GT4SgkmcSua99voA9+ORyVRLn G04NkhNFq6TkxbImES3EVphhGz0vw3cyC7 X-Google-Smtp-Source: AGHT+IEOHp+SrTUye1bSqLrXYpu7k+Ma4KRuYeCUPXZcv1mxFsOVjZLmdvv5DRZxFXu3JXWF1TxJdA== X-Received: by 2002:a17:902:e5c8:b0:295:512f:5060 with SMTP id d9443c01a7336-2962ad06a93mr8718915ad.7.1762284039354; Tue, 04 Nov 2025 11:20:39 -0800 (PST) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-341a68c822dsm285536a91.8.2025.11.04.11.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Nov 2025 11:20:39 -0800 (PST) Message-ID: <81c8079b2db02ffffb6a6a99523cd87047811963.camel@j-davis.com> Subject: Re: ALTER TABLE ... ADD COLUMN ... DEFAULT with volatile function loses DML From: Jeff Davis To: Tom Lane Cc: pgsql-bugs@postgresql.org Date: Tue, 04 Nov 2025 11:20:38 -0800 In-Reply-To: <650759.1762280552@sss.pgh.pa.us> References: <650759.1762280552@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-11-04 at 13:22 -0500, Tom Lane wrote: > Hmm ... ideally we'd throw an error for that.=C2=A0 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.=C2=A0 Not sure how hard we need to work at preventin= g > 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