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 1wC5Pr-001eKX-0W for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 00:44:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wC5Pp-003iQ0-1l for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 00:44:38 +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 1wC5Pp-003iPs-0t for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 00:44:38 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wC5Po-00000000khh-05AE for pgsql-hackers@postgresql.org; Mon, 13 Apr 2026 00:44:37 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-c757a9251faso1362734a12.1 for ; Sun, 12 Apr 2026 17:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776041073; x=1776645873; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=asSrBcUxBcG1z5ctXrf81jyTM3UGTasqkRi8b/qXCg8=; b=WMwgAuCzGyxX6Jl4SrOrjTPQKuti4u5/SABkSWDfrDT1J+cRoLBvevUQIJ6cjYjlvY 0qMHx50wAeszWTC9fPlrB/jr/OEIXB1o1ktw/wLgJHWIhtz3Y5fRvD8z+CPwym8I5sk8 lj0UCVjjU/wZKn0kSLxTNF90wdvH1/yNZJ3gvE3Vkb4YJ1ye3JZJ+hJ0zUzwW7inkgkI x0GPdrV881UO/XyBlnr+Ryiru0xfcQcyUD+l3DGJr4s5oBIrkRV2dC9zRH+oqg03lIEd bFybqpyk6rHUd2MVQ1yRBZcZXonAnzyL0nj0aCLpW7Div1ac9sLchJpRoyeUwQq73ZEe MUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776041073; x=1776645873; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=asSrBcUxBcG1z5ctXrf81jyTM3UGTasqkRi8b/qXCg8=; b=V4Vcli4yeuKDjCaHJxchKJ7/OqZOPkigGe7pDf2Tc96vYRN55Syoq4rNJakYHW32r8 ITMBL8WTjoH0Yyill5QggQBjSmawcrrLvT4br1sKL54/IVKVDZy+svvvdN2mjDsFIESw xwR4IbyGnzYwR8SlVGXDwmipZuFp7PZ75xyiGG1AY9yWJaJk9Kh1hbtLYrxyY7xt9zKZ eLyDeEUMEO/w/PJUDJod5k7nhN5iDvnA9xRf4L7oxFpNtFremsgpNcYyv9LJfiLkEdYI 3h9eK9EJQPUDBhZcV+K1wi08T1y8w+ISTWffBMfl49RVcg9DC5UkelZEUGYgnzpGLXNc FF1A== X-Forwarded-Encrypted: i=1; AJvYcCWopWd/SZB/e1b8etTyicgEWp+8c/CtEBnXzUp/hk5XrFnYl9NMZ+ccCTTVvBQcAJy5qgvglm6TjSB45JQ/@postgresql.org X-Gm-Message-State: AOJu0YzGtP4+Q7tD9RC+dnFo+aV6Qm4+ejWA6NGn/ASGNrg/GjeJaZjw 4nwgesA3Z97DVBNawQJtXSW5ju7IbR+jgZjJA+0eQQKaWT7cVThL9T+/ X-Gm-Gg: AeBDietbRvFP1NdLf7OYRVRATU5iZOJI5YsTwDHWuW+C+bzga2ID8i/WIylrVFxjLpn KEvmRfFCQ3Yc3kDncvB1hmzBeJlmBNWQAvIwnuZprqraAEmFTzllAHEHdvlcpk6sjNMEy/Kwsp/ /tmmgtNmmkKyLMXT0BY+bxoSB5sDUJ293JqkH+bI0Feb7MpWZI026SqOg/TTfw+DjceGpBEsUEy ztFzMaOw7J8jVSBzbtFMQ1nNdYYdwwdlPqApMhC/6cdxTfokzxul6Tl5/PTyygCln/gxeCYg1aj iN8ZRKMCfZJoc6CnyzfuLsnnUVP+bAcP6+IAjoaBRs4BHC+YtkXXPeosOis2Wk/NmoMtxvBF9ue bmck2H1nXnVWhgKEI4NS0pxDmX1PbWA2h9c3k9pXFV3/3ajok67rDBPFCKIH+x6NqRjIe14plIM HaPAfTiJB74/cQX02MDrtyTcOxvmwuBuM= X-Received: by 2002:a05:6a21:328f:b0:398:b16f:703e with SMTP id adf61e73a8af0-39fe3fe860amr12033809637.40.1776041073410; Sun, 12 Apr 2026 17:44:33 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c79219fe2d5sm8481009a12.24.2026.04.12.17.44.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2026 17:44:32 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Fix pgstat_database.c to honor passed database OIDs From: Chao Li In-Reply-To: Date: Mon, 13 Apr 2026 08:43:53 +0800 Cc: Dapeng Wang , PostgreSQL-development Content-Transfer-Encoding: 7bit Message-Id: <9D34D3BC-9F52-489E-98BE-6CB595710446@gmail.com> References: <8CD3DF77-C4F0-4CA0-B329-2B62B5A85E3B@gmail.com> To: Michael Paquier X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Apr 13, 2026, at 08:16, Michael Paquier wrote: > > On Fri, Apr 10, 2026 at 09:01:32PM +0800, Dapeng Wang wrote: >> Without the patch, calling >> pg_stat_reset_single_table_counters('pg_shdescription'::regclass) >> incorrectly updates the current database's stats_reset timestamp >> while leaving the shared db entry (datid=0) unchanged. >> >> With the patch, the shared db entry's stats_reset is correctly >> updated, and the current database's timestamp is not affected. > > The coalesce() trick to bypass the fact that the reset timestamp may > not be reset was a bit ugly, so I have used instead a second reset. > I have limited the test to check for datid=0, not MyDatabaseId. > > There is a bit down in stats.sql an extra portion of the test where we > use twice pg_stats_reset(). One reset could be removed, but I have > left it as-is in case someone decides to shuffle or split things in > this test script, to avoid problems in the future. > > And fixed that down to v15. > -- > Michael Thank you very much for fixing the test and pushing the patch. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/