Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3IuP-0007Sw-Ky for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jun 2022 15:01:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o3IuN-0004U6-OW for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jun 2022 15:01:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3IuN-0004Tv-Fv for pgsql-hackers@lists.postgresql.org; Mon, 20 Jun 2022 15:01:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o3IuE-0006WG-08 for pgsql-hackers@postgresql.org; Mon, 20 Jun 2022 15:01:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25KF1P4v2525300; Mon, 20 Jun 2022 11:01:25 -0400 From: Tom Lane To: Alvaro Herrera cc: David Fetter , Robert Haas , PostgreSQL Development Subject: Re: Finer grain log timestamps In-reply-to: <20220620110514.athzygshxtln3yt6@alvherre.pgsql> References: <20220620110514.athzygshxtln3yt6@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Mon, 20 Jun 2022 13:05:14 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2525298.1655737285.1@sss.pgh.pa.us> Date: Mon, 20 Jun 2022 11:01:25 -0400 Message-ID: <2525299.1655737285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Do we *have* to provide support for arbitrary numbers of digits, though? > We could provide support for only %.3t and %.6t specifically, and not > worry about other cases (error: width not supported). If I were coding it, I would allow only exactly 1 digit (%.Nt) to simplify the parsing side of things and bound the required buffer size. Without having written it, it's not clear to me whether further restricting the set of supported values would save much code. I will point out, though, that throwing an error during log_line_prefix processing will lead straight to infinite recursion. regards, tom lane