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 1sUIjA-001ytL-Ng for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jul 2024 04:26:49 +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 1sUIj7-009Q87-Pl for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jul 2024 04:26:46 +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 1sUIj6-009Q2P-0P for pgsql-hackers@lists.postgresql.org; Thu, 18 Jul 2024 04:26:45 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUIj3-00080q-DO for pgsql-hackers@postgresql.org; Thu, 18 Jul 2024 04:26:43 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id EBFC5138024B; Thu, 18 Jul 2024 00:26:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 18 Jul 2024 00:26:39 -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=1721276799; x=1721363199; bh=ePj/woeTJt C/4R1d6XJLSFxUQM1624PQvQ3e2ustI7Y=; b=Nz7qxn51Eo0t4UhLkBZq9CNjMG xycAJXtcFfM+5l8eV8RPONhmCmy4hI+OTTOzIT8DlvMN4QqR589saJoEWggRwwca CrSV+lBcyqaBLvOMqhZg/Wo0ykXcAgiE+llx0JfRQTUuABLR4RegFJqTvrhElpwR 5k0j18oIyDzIeThWEB0yAdDuXZL/vk1rD8P5cOJ+Dg4bQPflCAlBu4+hAn52i3mL xLvgr1gDnyjWsq/Krdj6ZWBPt9TrVIIstP5t/036HWQ+KCvUY8cHPTmxsgcLXtKA qcrvI2VC29oi9xwThzqY44KVT9PpQ015qlf3pKVE80+cerFa20S5DVgygQJQ== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1721276799; x=1721363199; bh=ePj/woeTJtC/4R1d6XJLSFxUQM16 24PQvQ3e2ustI7Y=; b=mx9Ds1xP6NmJ99sfsLqq+m7WoKOAjlueLzStpFwiyAUs xNZ21uuTrGBG60meLG+h9e4bFraVrObhujHKPjl5EHIuMKaAl4MvEu9TW9y1tiHQ bmTM3vum16YfJdDH8zrUnskLrj192N5Ao8FyIhGGbZahjhz95UZJOMxyeTTYB/E4 I/6lVYxk3yN0JbCWMeK+uTqGAMdDQFfMCxp5ECLsjqo9y1aw1uCNSPRtaONm0PoQ suE1eIXG9IbgC9Y9EMIg89jHZnTT10i8fJ0O4EEkXGH4J+r/nnhhmxYjDMuZyq+U aaEf70HKPaJ1jiZURJ+YY+xDmDED7nf9CrC2ZROBsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgeekgdekhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Jul 2024 00:26:36 -0400 (EDT) Date: Thu, 18 Jul 2024 13:26:29 +0900 From: Michael Paquier To: Joe Conway Cc: Tomas Vondra , Gurjeet Singh , Masahiko Sawada , PostgreSQL-development Subject: Re: RFC: pg_stat_logmsg Message-ID: References: <89742024-d51a-c66b-90b9-67f837072cd2@joeconway.com> <3b1683bc-2630-a0d0-6083-8a45aa1b54bf@joeconway.com> <5dc12198-80ff-4e70-b187-11ef33418411@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zw9s+NVV752oIikv" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Zw9s+NVV752oIikv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 17, 2024 at 07:48:15AM -0400, Joe Conway wrote: > I think including version in the key makes most sense. Also do we even have > a mechanism to grab the commit sha in running code? Not directly, still that's doable. The closest thing I would consider here is to get the output of something like 'git rev-parse --short HEAD` and attach it to PG_VERSION with --with-extra-version. I do that in my local builds because I always want to know from which commit I am building something. Then, PG_VERSION could be stored with the entries while hashing the stats key with the version string, the error code, the source file name and/or the line number for uniqueness. 32 bytes of room would be most likely enough when it comes to the PG_VERSION data stored in the stats entries. -- Michael --Zw9s+NVV752oIikv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmaYmXUACgkQnvQgOdby QH1y1Q/3euKfAUkj2RuctriTLDrSKeDiP6JyRpgbcoMAc9KrIfh23aEZfO2EhFES 4ecGbhGk1mSsYsQMe6qwJfuBJlPmf+YlAcG3m/XuH4dmMVbqBBNhi0By5tXHML1T xzJHrvsJYVzvnoKtfQ6GkuBKOpVDT6hcXALiSGftROQkHbICsHGsZDcER8paelih 1z7smaRje98e/kPHtnu9dQN7G+EOPOIAs3+hg1kkyY5aO0MtLjkm/oVlumHn0dOM BDE8Ckx96ycPLKDeOoB5U/1ixdFM8KVj9Jpy+nW7tZ6fYVC15bAFoett3j+uNYLj rswXOwD0Cfqa+Mx1U0qXyd/Pow9EuHnn6mrM7BQinBushnfT8v3UBvoJDfP5r0Gt HPOaoERKQnsGkTeMpDs7g3+7nGyW7aukR892XFvloh8v51LwB1TJDmIpJfKYF1o/ neSaR9O5Bgjm72O2KFGTCn9TqiCf7cdMxpiOzCYkcALx/YSHhnSRe9d2CCvV41v7 DOuXKku8vPUCRt5Lyv2MvXAn9yf4Og8LaHj/gYNIN0YzIrK76f3gHwXjrhFHkGHX bN/tAs80rW1a3bpU3an8HtThpiqwPNEkMHet2OFuIkU3b6zYKvcAo3/rw0O/iYwq jyJb1BpFYSxYBkxGVWo9RMMdApBN4NI4ES+thrssJbRuZkF+Bw== =FZvg -----END PGP SIGNATURE----- --Zw9s+NVV752oIikv--