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 1wB56x-000iX8-1z for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 06:13:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wB56v-009dxU-2y for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 06:12:58 +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.96) (envelope-from ) id 1wB56v-009dw2-0X for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 06:12:58 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wB56n-00000000Iut-496V for pgsql-hackers@postgresql.org; Fri, 10 Apr 2026 06:12:52 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id C8D821400127; Fri, 10 Apr 2026 02:12:46 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 10 Apr 2026 02:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1775801566; x=1775887966; bh=//rMpcKs6E 2u1T1vfXmZVCiyhFvYpqdVvCwD2tWysfY=; b=Qz9hj/pKNPObe1SmDrRW5VPhCW dc388UV7S+eSxULI4R7/TInoju4bmjkrg8kaLc01f8R/KjchZbqTRvIVC5NAfBLk yKICYBG0sCoAYWIE8u9v9bXKUUx276Lj1sjGsKIsP2CII8ISqMP+y9WfBT8+jgKG 1a9Femokpj7fin9Q1dJnE0C0fCzz7271W5RRN4K4hhWAOGb2U0besh7ntK7Jyx/P 33RmHD/8U6ITDXr4y4j60shgCEBifs0aDKPV6hDItJ65D46n6cN0G4u6sEjMgRny rCZT8jP1DY2DVpGd2rhrqGI0JHxTeocc9N5kjrJvSDIzogyQ7NrIkXbMzzNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775801566; x=1775887966; bh=//rMpcKs6E2u1T1vfXmZVCiyhFvYpqdVvCw D2tWysfY=; b=j0t5mkTtRgEj+/ZoNdQ5Cm6izX6wJpEghcax/6spBJfY5PF2Tmk VYarXZWbqtVW10r7zFVNDtUmegVoIsvSmdtXzcQOwSzIM+GyTH1cF/R6z47E8LCW 2nhLKUYwiJG6lY1Rr27SdbQF12aURdaT7G70VPr0qqurnKVsMT20QJNbY/YI/NKu yABKB1abLB25FvybWSK6KsUU2esiNGTgJPz743yCKAypxP0Wpgl7SFhtvtMm+Egy J3p0d1JHW0JbeNLUQ/XuJwGjlrN9SV7vJxk2nAHW6AvikG6iIzmlLgdIRrBBz7KJ m2d00+0KCFkqS5OfKt/yjjgAlZiv9qIdPng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvkeeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuf fkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgv rhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpe etleeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvg hlsehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohesghhmrghilhdrtghomhdprh gtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Apr 2026 02:12:45 -0400 (EDT) Date: Fri, 10 Apr 2026 15:12:41 +0900 From: Michael Paquier To: Chao Li Cc: PostgreSQL-development Subject: Re: Fix pgstat_database.c to honor passed database OIDs Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZUat1LXRJaG7ex9B" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZUat1LXRJaG7ex9B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 10, 2026 at 01:53:15PM +0800, Chao Li wrote: > For pgstat_reset_database_timestamp(), in most paths dboid is also > just MyDatabaseId. However, there is one path where dboid can be > InvalidOid:=20 The call of pgstat_reset_database_timestamp() in pgstat_reset() is a bug that has to be backpatched down to v15. It does not make sense to let a caller of pgstat_reset() pass down a custom dboid and then decide to reset the timestamp of MyDatabaseId instead. The call of pgstat_reset() in pgstat_create_transactional() is the only fishy one, the other callers are OK. If we decide to expand pgstat_reset() in other contexts in the back-branches, we'd be silently trapped as well. The connect and disconnect calls are less critical, perhaps we could remove the argument altogether, but I cannot get excited about that either as some extensions may rely on these as currently designed. I cannot look at that today, will do so later.. -- Michael --ZUat1LXRJaG7ex9B Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnYlNkACgkQnvQgOdby QH0L4g/+KWnob9Y6wazyQ5Yq7kOcRWJQrbvMyOBHYX9rPWnUFcKTU+1vQ+trY3nt XHRsQ4Va21BX+vnidulcYSGajsPBIbdqRdwNVN0YDwy5CqimYS9kZbMr+szkoMpd YnqBDN64HhW1Tkg4iX6DIjAAWJA7+AIbyh3p1ag4o8s3gHjnhf84BMqBsQ1Wi2kJ Vu/EAfgso5GBXybUF3Of4FYZegeR2ampE7WEaFDAfjyb6+S/N6Ia1Ssw3CJKW1Ut dXrdFWTx/lWbFst4gV8alH4N6Fm5mOEzn9I2LENr9Wzmt1LA3+DSiGFkviE139+T z0pAZiQbzkRv0A5ixR4U/9onVJDf/LhYmCWtP4ALqYYaWy6bR3OJ/rrSOAVFuEdB qbhdddu1zJSK+pL9BSwalaIgqMOY69q6OfnuVqbE8d/Wx5+3rLOsyY/BiHXy+B6p n3RpXXRQNABt5G1lH44x9m3LgFNmCj3mVm4i/5dWyTGZ4ZcTs8H05YmJjTdAaTE2 NCN9+mRJ0MwdEEYz0rfwdA6jV9OCPwhD82KUvw3wU3pVDX3hlKJAOY/0YEeWkSf/ g3g+23yARygzK2tGbAwj9SKhiCcygWIaAvANW0iLT9XGT/XVdcXPjTonPCl9U9o+ sBVJsoab0zsnL+uSaBvrcbEEF+QbDC+0M1Noe1rmI3fZZmeG/iI= =eLE8 -----END PGP SIGNATURE----- --ZUat1LXRJaG7ex9B--