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 1tWFGH-00FFHy-MG for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jan 2025 13:41:18 +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 1tWFGG-00GOxt-5I for pgsql-admin@arkaria.postgresql.org; Fri, 10 Jan 2025 13:41:15 +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 1tWFGF-00GOxl-QM for pgsql-admin@lists.postgresql.org; Fri, 10 Jan 2025 13:41:15 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tWFGC-000uoA-1O for pgsql-admin@lists.postgresql.org; Fri, 10 Jan 2025 13:41:15 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id C6E4AE0F18; Fri, 10 Jan 2025 13:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1736516470; bh=3vGQKh+kKGq1nWf1a7nO6bfwu9sj6ZOALAkLUkN0sbM=; h=From:Subject:Date:References:To:In-Reply-To:From; b=FxGVIF8Lj1xeRGxfQ5zxWmOF9QnCYULrbOvI9/t3scpTR7dqMbad9Fp2Pj8JlhfoW Tpqi6CDy2Jsu2KF5xmAMhnfLGh1Vjts+HNmE0LLmOxjCHyOJCc1AXSuHIKD648bWUW XUl0aS+DN8SEs/Bdf4UhJtB8gR/NQ8bgSX5iMQY9MPsfdM+8GEFH3m30ZhPmJ3CnDt XQO4zcxZbO3vr+x9qGrHUQHr6I2dN2SeQhOg46ZWc5nO53KFmrB0wIywKaKnBp8rx4 M7/vz0F9kYPQgRWpgR9vkfKaE1pza25v402pF+lwtxHsR5HBEO6o1xLG8LCMrIVGOL Dh9T8x/u1U+rw== X-Virus-Scanned: Debian amavisd-new at emo08-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo08-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2jF5Yo0aintR; Fri, 10 Jan 2025 13:41:10 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 522D7E0E0A; Fri, 10 Jan 2025 13:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1736516470; bh=3vGQKh+kKGq1nWf1a7nO6bfwu9sj6ZOALAkLUkN0sbM=; h=From:Subject:Date:References:To:In-Reply-To:From; b=FxGVIF8Lj1xeRGxfQ5zxWmOF9QnCYULrbOvI9/t3scpTR7dqMbad9Fp2Pj8JlhfoW Tpqi6CDy2Jsu2KF5xmAMhnfLGh1Vjts+HNmE0LLmOxjCHyOJCc1AXSuHIKD648bWUW XUl0aS+DN8SEs/Bdf4UhJtB8gR/NQ8bgSX5iMQY9MPsfdM+8GEFH3m30ZhPmJ3CnDt XQO4zcxZbO3vr+x9qGrHUQHr6I2dN2SeQhOg46ZWc5nO53KFmrB0wIywKaKnBp8rx4 M7/vz0F9kYPQgRWpgR9vkfKaE1pza25v402pF+lwtxHsR5HBEO6o1xLG8LCMrIVGOL Dh9T8x/u1U+rw== From: Scott Ribe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: Before image of selective columns. Date: Fri, 10 Jan 2025 06:40:59 -0700 References: To: Gambhir Singh , pgsql-admin@lists.postgresql.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3826.300.87.4.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jan 10, 2025, at 2:55=E2=80=AFAM, Laurenz Albe = wrote: >=20 > That looks like a job for a trigger; perhaps a statement level trigger > with a transition table. Indeed. I just want to add from experience: put the row values into a JSON = column in the audit table. Otherwise, what do you do when the table = definition changes? It's not just that you would have to keep the audit = table schema in sync, it's possible to have a change which is not = compatible with the old definition, such that you now really can't have = one table that covers both old and new exactly, and then have to resort = to renaming columns or some such...=