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 1mJGxi-0007fj-Bu for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 15:06:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJGxh-0003H9-9r for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 15:06:37 +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 1mJGxh-0003H1-0b for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 15:06:37 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJGxX-0000Kd-RR for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 15:06:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B0FD85C011B; Thu, 26 Aug 2021 11:06:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Aug 2021 11:06:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=fqc6KpGsvqYFk4mz35qVojQ0VzfYuAZnbBgxWkM3K xM=; b=NDYo3hnUmzP8zfiR3wEcDkBeMFH8Whc//W0hjk+UER7Chj31396e+Y3m6 OeOicFcvu0EHp8OgpO1AVHhEuK4qDGleo6eUn4Umz+J09QXhP2lZu/VT1o7TTYao 7thEK4D3rwRT4vsAHSyGRZfq2Yo131AkNdEZ2P6Bqv2Tqo/J9sWvFh+cRKW/OX23 D2IjS94rfHdVd1pxg+W5Zs91yvl1g2R0kkUstPKDmTA9BK4UTZrax8GzrSCX/2Sm uPUv5UMTjkroB4OyUrKHxUUZ2TkC1dnUuuvQB2ufpIqxXfLVjMfEXJ1JuErShE53 1IxgiDqwUqTzoFgOJQXL7E6NucM0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudduuddgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepleevheehueeiudeiteei tdekueetleefteejffeiffdugedvffdvffdtiedvueeknecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Aug 2021 11:06:24 -0400 (EDT) Subject: Re: lower() and unaccent() not leakproof To: Tom Lane Cc: "David G. Johnston" , Christophe Pettus , "pgsql-generallists.postgresql.org" References: <02BDFCCF-BDBB-4658-9717-4D95F9A91561@thebuild.com> <648381.1629986401@sss.pgh.pa.us> From: Peter Eisentraut Message-ID: <7eb0e72c-d638-a223-858c-24ce29f1f2e8@enterprisedb.com> Date: Thu, 26 Aug 2021 17:06:23 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <648381.1629986401@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 26.08.21 16:00, Tom Lane wrote: > Generally speaking, we've been resistant to marking anything leakproof > unless it has a very small code footprint that can be easily audited. > > In particular, anything that shares a lot of infrastructure with > not-leakproof functions seems quite hazardous. Even if you go through > the code and convince yourself that it's OK today, innocent changes > to the shared infrastructure could break the leakproofness tomorrow. I think the complexity of the implementation of upper() and lower() is on the same order as bttextcmp() and similar, so it wouldn't be totally out of scope.