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 1sYuVO-00F1bR-Hm for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2024 21:35:38 +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 1sYuVM-00DvHE-1i for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jul 2024 21:35:36 +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.94.2) (envelope-from ) id 1sYuVL-00DvH5-JI for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2024 21:35:35 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sYuVI-002Jwk-6V for pgsql-hackers@lists.postgresql.org; Tue, 30 Jul 2024 21:35:34 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7a1d7bc07b7so310787285a.0 for ; Tue, 30 Jul 2024 14:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1722375329; x=1722980129; darn=lists.postgresql.org; h=content-transfer-encoding:autocrypt:subject:to:content-language :from:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=CYPNK+5YfqU0LXyPhz6zC9woH3FhvGM9LxB1uHPnfuk=; b=HhOHtEOnt4z2H9xyINfBV6mkTza2Vo1AnPjC9fEGQUP3dCkO15abfOSGEJKa2U/FIv igCTKV4BJlrSkkdKBkhupfZqxjLciq0BSIAC/g8OQ1cZfwlWW4pDOVU3odWD/+lQFd9W TBbwT4WSz4KTcBCYCa/Q1RGZupDRE+RfA0FfEg4BGnwkxkOQT7aOBQeI5B47MyHUgyW7 m4A/9Kn551FxPYjWLXRAPWBwZ7J7blNyZFF3lbBN4XzAhfMQRuaM00OiQcZzPBpS3Mh0 teRv4npgnRcE+p8zZ5vNlUOLqwwUfRxx8bFyYlUCgoLxZ7mrOz+pgE0Xv92s8nsTq5nX 2lvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722375329; x=1722980129; h=content-transfer-encoding:autocrypt:subject:to:content-language :from:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CYPNK+5YfqU0LXyPhz6zC9woH3FhvGM9LxB1uHPnfuk=; b=Ga+OG282hn2pCWIz5lSxrYd5Svrpk4cVUm3BVtsSJchjTR2kg/bYemNXIJw+pTJvKe 1w4pDmf0NSHX1xUB1AnnGFqNLzaAopafTNnBalNDYrNIF0zgJc/mdlGZeaKpXYBn5SRx zkgX/RoHJUga3l8ueQw2f7PfaD/MKt+n50fCp7rlc1HZxtMI7NhGCr5E8vGvLBSkCM1s LkWjXUM6tOLGHo1l/H8W+RCUlAU6eZtci+ubxau1T1PjtufgmuqNJ3lEak6S2NBDBQNN oaLjMPr5b/Ic8C7QWd9Kn2h1cqevmPFwhBhTpY3Xm80nMPgyNsAvcxkGx6jk3+JXneMx behA== X-Gm-Message-State: AOJu0YxaKHOobpbTichyGtYgAWmEwnhFxVlD6ikJeM6TAYa+X0Y4CGyB BfCBlPdSDN9th9LtsvgOLgqpPwJ+XzYZGYPY4NUdhmHLOulcvHOZ+lfm1fh1NiHMHYevCdOGOgW H X-Google-Smtp-Source: AGHT+IENUlgSFfMudQLcX5RUquiTcjocJV4zChY4wNTxavBNI/aPaRJIMOUg+tVO8ZmIcY+RAR/IIw== X-Received: by 2002:a05:620a:244c:b0:79c:f55:4fd4 with SMTP id af79cd13be357-7a1e52fbbf9mr1600331085a.59.1722375329479; Tue, 30 Jul 2024 14:35:29 -0700 (PDT) Received: from ?IPV6:2605:a601:9180:9800::2bb? ([2605:a601:9180:9800::2bb]) by smtp.googlemail.com with ESMTPSA id af79cd13be357-7a1d73955d7sm679517885a.13.2024.07.30.14.35.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jul 2024 14:35:29 -0700 (PDT) Message-ID: Date: Tue, 30 Jul 2024 17:35:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Andrew Dunstan Content-Language: en-US To: PostgreSQL Hackers Subject: can we mark upper/lower/textlike functions leakproof? Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAHNJEFuZHJldyBEdW5zdGFuIDxhbmRyZXdAZHVuc2xhbmUubmV0PsLAmwQTAQgARQIbAwIX gAIZAQULCQgHAgMiAgEGFQoJCAsCBBYCAwECHgcWIQTkPlhGHfx8v0RpFaWZ+n/LWfw7gQUC ZFlxxwUJGVGAbgAKCRCZ+n/LWfw7gXikB/9ZdcUy6CTBFIIuL/bVsc1eLEW/gJBjJBF6HxNY xgEkAgXAp4Lg4A5U+QB9GouFr7+GYxF0BU4hzoGhNPUWltxnHdMWP8nC/38LAqgMi8L/bbsm HW5YPBdWYaAZAPJQVfOAgjTbR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: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Several years ago, an EDB customer complained that if they used a functional index involving upper(), lower(), or textlike(), where RLS was involved, the indexes were not used because these functions are not marked leakproof. We presented the customer with several options for addressing the problem, the simplest of which was simply to mark the functions as leakproof, and this was the solution they adopted. The consensus of discussion at the time among our senior developers was that there was probably no reason why at least upper() and lower() should not be marked leakproof, and quite possibly initcap() and textlike() also. It was suggested that we had not been terribly rigorous in assessing whether or not functions can be considered leakproof. At the time we should have asked the community about it, but we didn't. Fast forward to now. The customer has found no observable ill effects of marking these functions leakproof. The would like to know if there is any reason why we can't mark them leakproof, so that they don't have to do this in every database of every cluster they use. Thoughts? cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com