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.96) (envelope-from ) id 1wzVJ4-0043MV-22 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 08:17:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzVJ3-000plw-1t for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 08:17:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzVJ3-000pln-0S for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 08:17:53 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wzVJ0-00000002eOv-0OPb for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 08:17:51 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-3964dfb5b9aso2553424a91.1 for ; Thu, 27 Aug 2026 01:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1787818669; cv=none; d=google.com; s=arc-20260327; b=tBXA0ct6FTgbh6gP4Rpb7dROwgJlguM8Mtty3gFI9HVPRDByw66Ir5UwrX9RALbcEv fHK6OpyIbE5xhsTdK7+D22g0ghjgbEHEEiBLbkVOI3SiR0nlw7oeFWehuppXOdqpurqm 4yL4HHlGgY74UtRZFBvJlf4Xkoln8GpG7flak7V7rtWN7J9RKL8H3wbP1J+H5aAXAXGM YfUBhkDtAUDrRFlXDcqvbSFzMBm1nVRQfbmRLwqoMzbEHEmKXV8IGhK5Tr1JiVKnCwHR M5czp6KJM2OJAapIJKhKjuG9KNqF45qLWcwc1Z+goHoaLfC5OZtkM3w1Whn7h915wKA9 45Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=+0bdElvul969dca99yDuvTFe5enICFa3541mfQpyAhg=; fh=wbHQqR+Pm6Aqbc645ZeI8cExEom6S152n5dyevH9CNw=; b=RfVBYyIwL0czYBFBoZklASVi8uxriwhDw2EZ5RuPSoAwFKZQK6udlXFYieJXLCIxX7 1L73+Wp9Mf9Nf9id41iGmYNYoLJr9w36cBv+wCjylz4BMK3Qm8tc7AbRvY4YnviRT5xM Hk61MJBIbVUjwGC9aKv4CqE21uii/k0qxajPFleDadz3+jdUpPX/EeMPuo/g3DlSj3fY i3SI3TBQpDoBO90p01XdUa5TW6VXzV1PaE5AlHqH3bVKb7SHUpq2YIuOSo99ay6D+gng LtmU9hI2IXagdkmjxLILOif3mYQDzLwQMt1tzgkVGUALtK/gG3QDCALuAQyhxT+TMpJn oV4w==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1787818669; x=1788423469; darn=lists.postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+0bdElvul969dca99yDuvTFe5enICFa3541mfQpyAhg=; b=VCrIwbS/18JquBVt233U0aNj9PpakVbi/GIGw5hLyhPr2F3PRQNWlNvl72pGC65oxH 9mcw4YQyEgT0ugxuyqlJg8Mw1JqiMywXqS3ZZ0Eisfv45qSrW6gogFuOoK7ZfZ4tff8N teoCT4Ub+uiqZp80l/zre1chbpHqaLIqdH92qW++dO6vH2lEGgi+/g5svGcw89AS+QcH iuGmkc/XU866e2LftfmxvMdg71XRYQERlvuBSpAdLK9BouQeVWwQYPXXpMrSChYTWIA8 IbrL8lsilsqmbPKj+4xvijF+v9zLWAFw2rOL9RSH2ca4/qd6Q/e34zvqtHX6wosilui7 4LSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787818669; x=1788423469; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=+0bdElvul969dca99yDuvTFe5enICFa3541mfQpyAhg=; b=cpRhpgHCc9wMW+StWZ1bejtAUPztSi7MfbEOMwt8gSDMrxvH7M+wxMkKmKDjGda6K/ Wp5Z9cjW5li8P09vQ7FTieePnDatbukzgFRKlFxzySsURrQyJRZFd6hU6gLIMJ74gfnK FmETNNvkCm41uPLIuzqKFSNm58MNzOQgUTVp9GwYq9BoF6/FESL4NkK9th4Iv87NFHwB XtE4MtDTQgSzGnnsUUCmdGjWP8tl7oXe4ellHQZLxvfc8BixneTYaQefGjuyzAZMQVrG gIM+ekokasoWGuWRF7r/eul1C03onsE+GQsMbnuyYLSyMxSQjMiD0t/OfS18sVf1iFnD bqdg== X-Forwarded-Encrypted: i=1; AHgh+RowdprclK05R3+BlVzbp25qem530N/SF3Y2RRoTcLxkaqS6Uw0c/0kje9Nsrcc8GrVT0ZJodNGQ9aQ+Zokz@lists.postgresql.org X-Gm-Message-State: AFuF++lclQcPCW7Vh8jHlX2ML7eHc8FdySw5nVFvo7T7tzTpkmC86KIi 7eaG68mkZB2YDXjZfsixIxqPpqvBNVjw3YqPlCPG0ywEvkQJ0qDDL3gY50W6AoxCYEJSV48Gp8S Y1LmgVwFRDMNxRsS+mESvl3damY8ttFDdl4G0ecCy X-Gm-Gg: AR+sD1368nTd19+vZTouBcfHwIRMnVuEEIRlJReU/6LpUwa3Ls6J717IaP/8PPLqpoE zKvcGoHI9hihHHb0/eR0lT7EF/XpRqNKtMEWNU+hYEc8e09FSPSS+K5gGx7g6o/hAJ8uYwWE14U fNYFRlaMAB/BPxIu1l4lM4592RoaiQlBUOVhyrKpfpc3FvjDIzsNTrm/cp70xch3TgttOe2CiPn ikhE+2+umiAyYZ6yo+sUPyDxwPG5iovq43Zt4AghENCzqiX58DBBRaphzJU3VBqvz1u3J2w6rfu fykj911If5EntQjCf8bSmY0DM3EPlffXViVeZd4VpQWwsQzYbCGr51gq X-Received: by 2002:a17:90b:530c:b0:38e:b400:a860 with SMTP id 98e67ed59e1d1-3966d443d6bmr24915582a91.13.1787818668573; Thu, 27 Aug 2026 01:17:48 -0700 (PDT) MIME-Version: 1.0 References: <5qh7ejjkh3526tpcjosqulitnvgumj25wsxv7iqjgev3qqoi7g@w73fcwn2ul5l> <9a75f8e0-9078-4637-89ef-96580985d37b@dunslane.net> <55A96680-B215-464B-9451-52F2910BDE83@anarazel.de> <898256.1787807242@sss.pgh.pa.us> In-Reply-To: <898256.1787807242@sss.pgh.pa.us> From: Gabriele Bartolini Date: Thu, 27 Aug 2026 18:17:36 +1000 X-Gm-Features: AcwNN1V_9GrrWIhJYEE0fP3l2wlOHEWtBrb7HAB8NSHcZ99bWpkf995PmBmHdVg Message-ID: Subject: Re: Tracking role modification timestamps in pg_authid / pg_roles To: Tom Lane Cc: Andres Freund , pgsql-hackers@lists.postgresql.org, Andrew Dunstan , pgsql-hackers Content-Type: multipart/alternative; boundary="000000000000a9d8a7065a02f8f4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a9d8a7065a02f8f4 Content-Type: text/plain; charset="UTF-8" Hi Tom, I think it's worth addressing these architectural points directly rather than continuing to narrow the patch's scope in response. On Thu, 27 Aug 2026 at 15:07, Tom Lane wrote: > I don't think that limiting this idea to global objects does one single > thing to address the problems with the concept, such as what are the > semantics for dump/restore. On dump/restore: pg_dump and pg_dumpall are unaffected by this patch and, structurally, could not carry this column either way. dumpRoles() in pg_dumpall.c selects an explicit column list matching the attributes settable via CREATE/ALTER ROLE, and there is no such clause for this timestamp, so it was never a candidate for inclusion. A restored cluster, therefore, gets the restoration time on every role, since pg_dumpall replays CREATE ROLE then ALTER ROLE rather than copying the tuple, and pg_upgrade goes through the same path. I'm not proposing to change that or extend the grammar to carry it through. The semantics I have in mind are strictly "the timestamp of the last CREATE or ALTER command executed against this object on this server": instance-local, live-cluster state, not object history. Under that definition, restamping on restore is correct, not a tolerated limitation. A role that comes back through a dump/restore is, from that server's point of view, a freshly written state, and there is nothing to preserve. > We've discussed modification timestamps for database objects many times in > the past, and rejected them every single time. What exactly will be > different this time? > On "what's different this time": I went looking rather than asking you to dig it up for me. I found a 2016 thread on pgsql-general proposing relcreated on pg_class, where your answer was almost word-for-word what you just told me: "it sounds trivial, until you start thinking about backup/restore/replication situations, and then you realize that the required semantics are far from clear. In practice, audit logs ... are a far better solution." ( https://www.postgresql.org/message-id/flat/27666.1461177383@sss.pgh.pa.us#75f96d35e6e8424d57492288aeaca870 ) I also found a 2009 hackers thread proposing created/altered columns on pg_proc and pg_class, where you leaned toward Josh Berkus's alternative of a generic side table keyed by classid/objectid instead of per-catalog columns, with pruning stale entries left as the open problem ( https://www.postgresql.org/message-id/flat/24270.1239663969@sss.pgh.pa.us#ab1f5c7afe259305b1d15cb5e3a70d67). If either is among the threads you had in mind, I'd rather engage with them directly than restate my own case blind. Two things stand out specifically from the 2016 thread. First, your answer there didn't turn on whether event triggers cover the object: pg_class already supports them, and you pointed to audit logging instead, not to event triggers. That's a real problem for the argument I was leaning on, that this proposal only touches objects that event triggers can't see, since it suggests the objection to a plain column isn't about coverage gaps at all. Second, if audit logging is the standard answer, I don't think it actually serves the declarative-reconciliation use case this patch targets, and I'd rather say that plainly than assume it's covered. An audit log is an append-only history that must be enabled, retained, and parsed. What a reconciler needs is a single indexed value it can compare against a cached one in a single SELECT, with the same shape as an HTTP ETag or a Kubernetes resourceVersion. That's a cheaper problem than "what happened here", and I don't think an audit log answers it any more cheaply than an event trigger plus a side table does, which my first mail already conceded works, just at the cost of extra machinery. So, is the objection that a plain catalog column is never the right shape for this class of problem, independent of what the alternative costs? If so, I'd like to hear that plainly, since it means withdrawing this rather than continuing to adjust its scope. Thanks, Gabriele -- Gabriele Bartolini VP, Chief Architect, Kubernetes enterprisedb.com / Melbourne, Australia --000000000000a9d8a7065a02f8f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tom,

I think it's worth add= ressing these architectural points directly rather than continuing to narro= w the patch's scope in response.

On Thu, 27 Aug 20= 26 at 15:07, Tom Lane <tgl@sss.pgh.= pa.us> wrote:
I don't think that limiting this idea to global objects does one s= ingle thing to address the problems with the concept, such as what are the = semantics for dump/restore.

On dump/restore: pg_dump a= nd pg_dumpall are unaffected by this patch and, structurally, could not car= ry this column either way. dumpRoles() in pg_dumpall.c selects an explicit = column list matching the attributes settable via CREATE/ALTER ROLE, and the= re is no such clause for this timestamp, so it was never a candidate for in= clusion. A restored cluster, therefore, gets the restoration time on every = role, since pg_dumpall replays CREATE ROLE then ALTER ROLE rather than copy= ing the tuple, and pg_upgrade goes through the same path. I'm not propo= sing to change that or extend the grammar to carry it through. The semantic= s I have in mind are strictly "the timestamp of the last CREATE or ALT= ER command executed against this object on this server": instance-loca= l, live-cluster state, not object history. Under that definition, restampin= g on restore is correct, not a tolerated limitation. A role that comes back= through a dump/restore is, from that server's point of view, a freshly= written state, and there is nothing to preserve.
=C2=A0
We've discussed modi= fication timestamps for database objects many times in the past, and reject= ed them every single time.=C2=A0 What exactly will be different this time?<= br>

On "what's different this time= ": I went looking rather than asking you to dig it up for me. I found = a 2016 thread on pgsql-general proposing relcreated on pg_class, where your= answer was almost word-for-word what you just told me: "it sounds tri= vial, until you start thinking about backup/restore/replication situations,= and then you realize that the required semantics are far from clear. In pr= actice, audit logs ... are a far better solution." (https://www.postgresql.org/message-id/flat/27666.= 1461177383@sss.pgh.pa.us#75f96d35e6e8424d57492288aeaca870)

I als= o found a 2009 hackers thread proposing created/altered columns on pg_proc = and pg_class, where you leaned toward Josh Berkus's alternative of a ge= neric side table keyed by classid/objectid instead of per-catalog columns, = with pruning stale entries left as the open problem (https://www.postgresql.org/message-id/flat/24270.1239= 663969@sss.pgh.pa.us#ab1f5c7afe259305b1d15cb5e3a70d67). If either is am= ong the threads you had in mind, I'd rather engage with them directly t= han restate my own case blind.

Two things stand out specifically fro= m the 2016 thread. First, your answer there didn't turn on whether even= t triggers cover the object: pg_class already supports them, and you pointe= d to audit logging instead, not to event triggers. That's a real proble= m for the argument I was leaning on, that this proposal only touches object= s that event triggers can't see, since it suggests the objection to a p= lain column isn't about coverage gaps at all. Second, if audit logging = is the standard answer, I don't think it actually serves the declarativ= e-reconciliation use case this patch targets, and I'd rather say that p= lainly than assume it's covered. An audit log is an append-only history= that must be enabled, retained, and parsed. What a reconciler needs is a s= ingle indexed value it can compare against a cached one in a single SELECT,= with the same shape as an HTTP ETag or a Kubernetes resourceVersion. That&= #39;s a cheaper problem than "what happened here", and I don'= t think an audit log answers it any more cheaply than an event trigger plus= a side table does, which my first mail already conceded works, just at the= cost of extra machinery.

So, is the objection that a plain catalog = column is never the right shape for this class of problem, independent of w= hat the alternative costs? If so, I'd like to hear that plainly, since = it means withdrawing this rather than continuing to adjust its scope.
Thanks,
Gabriele
-- =
Gabriele Bartolini
VP, Chief Architect, Kubernetes
enterprisedb.com=C2= =A0/ Melbourne, Australia
--000000000000a9d8a7065a02f8f4--