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 1uWM8c-00CgTQ-5h for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2025 21:34:06 +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 1uWM8Y-002TvV-89 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2025 21:34:02 +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.94.2) (envelope-from ) id 1uWM8X-002TvH-Uo for pgsql-hackers@lists.postgresql.org; Mon, 30 Jun 2025 21:34:02 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uWM8X-004pjU-02 for pgsql-hackers@postgresql.org; Mon, 30 Jun 2025 21:34:01 +0000 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-87404493fd2so213791939f.3 for ; Mon, 30 Jun 2025 14:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751319239; x=1751924039; darn=postgresql.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=4YnmTq/teujN4wLPPxFsQ2nRX7B2Q5jlgPctF9ZQ41Y=; b=IFijfmLKhpqUOOJRmhLhYojImBqt9IQDac4Xv5jMHzZJjx6q2t2DeDj1NZSZbPfLot VIreuwN/g46WOg30u4JpSlWh7ufqpPF7FzDnrz23n9OJgU0ODPeBTVZNVFsk5bkPHlwH 2GmXmRggjqp9CPjJuTBPZs2OVNC+/oFqWpp1zoxssc5BdhoCMi0+X0N0GWGoQwEaysrb 4Rdpb3dBk+b7dBDiqaE17ilQah4VTErkc5MjOlb9mPXwNxxWVitJ5qYgNkm0ObsVJNn3 +4yFLPJsHdC1Ag6m4GT2nuBAlSxtjVmlj8TirGZC/3NJy1C0WNbBFnLC4B70hzzLLp4L djfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751319239; x=1751924039; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4YnmTq/teujN4wLPPxFsQ2nRX7B2Q5jlgPctF9ZQ41Y=; b=pSN0RcYirSkUlJpESyqngrLD/VYFsRhgqjVN+1pN5BOcy6v5v4Mj2hUFatToCIPbzN YnwQ6JaO9QNiD6xUNnpgquf2UJHSWX4m9haWVAXaXgIzO2isumlSJ+39X2yXYzzlNMUJ j6waWWpntXPRafb3Ep5SSVHZJpPA1yiH8KbezhOy5ehagph9Pf11pOtjfWX/nGuKUnnA X6/2M8hrOn0mPhZ2UpLD2nrxyENstDASu3/kWBs8oa1IKg6MSRdDHOS7MHvaaEOYBo41 WTETsbbcRZ2hlp/8l7qDKoC5YAQCIZE7EO+Gyni3DU6yjKSzAqnq6wcHm1ZRJWd/vxCd gfRQ== X-Gm-Message-State: AOJu0Yz8UdTow96e5YSMSt5hKxUL4APTpQ2LyxgUIq7U5F9NfZqf3RoV v3OERUu2qF8lcjUuUi4rQEHoQPx0UodIwOeFjm95BtQY9PD6KWJLY1xqGy1THQ== X-Gm-Gg: ASbGncv9XyJW9V6NOEIwccLI4EYs0rxjmje3CN2WRcgt9CtK+dra48HuN0V3CowD1yO n9GBElfZIczN8cFG1zJOOzJQPoYPwIRSoU/NJ1r5CdgUk2kgBYiS7yY3WEoJ+oqySES37BDPWF3 1s/TYz43Tu5zI1VXi3I45s9Zht0K9w+cKj7kkmyGJipIO2Ficueerms5uxfUGjaSk9HbRNNs2zu SaGH4P9smG9cZuCVsJCeydoOoMNLjgPUjQghGEG7vGFbJfR6IK16NKV6ttilV/qMvEKzyvWX2li abKVFpeAcD9SrUj+u3S29E1BpTOkPh92Do4jpe3Yjbsqp/NtOrf8wNuP0rElpCqyKSKHkqRgKgG 5Sj8P+BBgJy+w8k+UJDR9hx1j3qvJ3HylnDX1/xazXNiPqbRAaO1N X-Google-Smtp-Source: AGHT+IHR72DgfsnJVW9fCp/fW2LWevIVwkHYbgQNdJJ72qO48bu3+L0bA2aMHVFJCfp3YgslMRLBhQ== X-Received: by 2002:a05:6602:3411:b0:875:b8b7:7864 with SMTP id ca18e2360f4ac-876882fb6c4mr1807484739f.6.1751319239251; Mon, 30 Jun 2025 14:33:59 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-87687b0e190sm215991339f.40.2025.06.30.14.33.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jun 2025 14:33:58 -0700 (PDT) Date: Mon, 30 Jun 2025 16:33:56 -0500 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: back-patch documentation for age() and mxid_age() Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NIKakGvuI9thMFLF" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --NIKakGvuI9thMFLF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline These functions have been around for a while, but commits 48b5aa3 and 15afb7d were only back-patched to v16. Any objections if I apply them down to v13 now? -- nathan --NIKakGvuI9thMFLF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-Document-age-xid-and-mxid_age-xid.patch From 5c2fafe16a95bea32fd0808d596afb18446f69a6 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Mon, 30 Jun 2025 16:21:34 -0500 Subject: [PATCH v1 1/1] Document age(xid) and mxid_age(xid). --- doc/src/sgml/func.sgml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 372cb036fde..f11c4f711d4 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -24638,6 +24638,34 @@ SELECT collation for ('foo' COLLATE "de_DE"); + + + + age + + age ( xid ) + integer + + + Returns the number of transactions between the supplied + transaction id and the current transaction counter. + + + + + + + mxid_age + + mxid_age ( xid ) + integer + + + Returns the number of multixacts IDs between the supplied + multixact ID and the current multixacts counter. + + + @@ -24773,7 +24801,8 @@ SELECT collation for ('foo' COLLATE "de_DE"); The internal transaction ID type xid is 32 bits wide and wraps around every 4 billion transactions. However, - the functions shown in use a + the functions shown in , except + age and mxid_age, use a 64-bit type xid8 that does not wrap around during the life of an installation, and can be converted to xid by casting if required. The data type pg_snapshot stores information about -- 2.39.5 (Apple Git-154) --NIKakGvuI9thMFLF--