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 1rfdlF-001Jto-SX for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 10:35:34 +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 1rfdlE-002b2z-9n for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Feb 2024 10:35:32 +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 1rfdlD-002b2h-Ce for pgsql-hackers@lists.postgresql.org; Thu, 29 Feb 2024 10:35:32 +0000 Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfdl7-0026jK-BT for pgsql-hackers@postgresql.org; Thu, 29 Feb 2024 10:35:30 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id D27A518000CF; Thu, 29 Feb 2024 05:35:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 29 Feb 2024 05:35:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709202923; x= 1709289323; bh=OcnarGz4izg71psxE3UbApa4V1KUgVD+DXg+YfSQSR0=; b=h UjKbru74J+5sbCEVTkP5G+p1pofV+f9ADThKH2b6sPHksXTe6xfAJ6E/Da119eoi yS2P/ZonsplPUTex6QBrptckqPe6FIQSNOa+fqTMmes97ArF3Pw0/tnn6/GDk97y YI12Wj5Q7V8e7wTjTutjKLr3G5b+zYGLrVepxipTXW8NBCXTDAHeibAIBr+6Cpxo aqRgsyRSxumdvmFE+UfeHznOITQ9vPVdnlukSgTVsUmnoFvd1gUiX64G5CNfNYOS kfsh14BNrRYD/qIK1varlyQJxeuIe8fVWMv5ERGk04APgfjjVPRtm9dGrOux5Cmi PSp/01goiLaXld10bwNnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgeelgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Feb 2024 05:35:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1709202921; bh=JFFgsUuy/SAiinnVtyIlE1Mw3LPezj18K0MizZs4Ij0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=U7CQKpnualyX2aqEI5ZY/0Apz10Do6O28Ft08n8LGrGNr8HpJG8wOQFxBl9GloRr6 boLXl9si2TJ6ODGhkVz0JH712AEkcE7Odcsc73kSei9ugydcLbveWYGTzfcPgxXcHo 5TLXFX9KuQPmiBO9hwmUe/GlnY5PkYcYn7lPdqzK+Zf3cslm9XFHNk/IE8TWi5/LId iZbx4SnQXQbTOamDqZT2gP7kXadVH0UqFuVCqNDe64DHJbBH9y/FQRmCjAWfMBdivG V8DqIrM+zXAqkbK1PLLs/NCXsJ034JIfr1OVjfOB+/YNJd3yF5rcTryvApl1P431lQ ja0gHuutUWTag== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 2ED83D40; Thu, 29 Feb 2024 11:35:21 +0100 (CET) Date: Thu, 29 Feb 2024 11:35:21 +0100 From: Alvaro Herrera To: Jelte Fennema-Nio Cc: Daniel Gustafsson , PostgreSQL Hackers , Peter Eisentraut Subject: Re: Support a wildcard in backtrace_functions Message-ID: <202402291035.op26n4voqmba@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Feb-28, Jelte Fennema-Nio wrote: > diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c > index 699d9d0a241..553e4785520 100644 > --- a/src/backend/utils/error/elog.c > +++ b/src/backend/utils/error/elog.c > @@ -843,6 +843,8 @@ matches_backtrace_functions(const char *funcname) > if (*p == '\0') /* end of backtrace_function_list */ > break; > > + if (strcmp("*", p) == 0) > + return true; > if (strcmp(funcname, p) == 0) > return true; > p += strlen(p) + 1; Hmm, so if I write "foo,*" this will work but check all function names first and on the second entry. But if I write "foo*" the GUC value will be accepted but match nothing (as will "*foo" or "foo*bar"). I don't like either of these behaviors. I think we should tighten this up: an asterisk should be allowed only if it appears alone in the string (short-circuiting check_backtrace_functions before strspn); and let's leave the strspn() call alone. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'. After collecting 500 such letters, he mused, a university somewhere in Arizona would probably grant him a degree. (Don Knuth)