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 1r1zPr-00EaST-CU for pgsql-general@arkaria.postgresql.org; Sun, 12 Nov 2023 01:37:36 +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 1r1zPp-009KyS-K4 for pgsql-general@arkaria.postgresql.org; Sun, 12 Nov 2023 01:37:33 +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 1r1zPn-009KyK-Ny for pgsql-general@lists.postgresql.org; Sun, 12 Nov 2023 01:37:33 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1zPk-0058hc-EF for pgsql-general@postgresql.org; Sun, 12 Nov 2023 01:37:30 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 59F8D32007E8; Sat, 11 Nov 2023 20:37:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 11 Nov 2023 20:37:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1699753045; x=1699839445; bh=CpHXLPACgIMch8BXxf/KZnzGBfek5Q1JfHH RHHyVKNI=; b=CR5P79X0S1sfK754P01Uo1B7IJ6FfBnWeZqC4IZ5PmRoE98tsRw kjo/9ZkqwFC9cmeSnoYqEjjB0jBeaQfMav95gJ8Xmjb+6aSUM9pEsAHRoMQxYFZL aR81RRhr8/Gd12HDyBczp5j+gCm2rS8OFcQAvVUQ8+JfLSVLNIO5Htx50GhcDQBk AXJLaD/V34+0yDvJCx3bmrLFPPx1eY8znxnzIYhMOjGGcv1lsc2BNrPrbDpNd9wm 409UEcPbghjNQv7oO8OlH+5bX1yEg2sy1PPPor4hdoFykiiorBLgKpvV5KbotkPr z4AaHhXmB1NfzkqHiCOxMw2Rd0wz8nx0ErA== 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 :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699753045; x=1699839445; bh=CpHXLPACgIMch8BXxf/KZnzGBfek5Q1JfHH RHHyVKNI=; b=lRinsYEIHnWFoKPCPizOM39lfsDrB3r1O/keoccYFf58wELYKbz v8a7hV2WOQ7EVP336kQEcZ1bJU+3+BNPj9yyHpR2eqY2SG6HNPEcKZAR/GTR/Oz6 bpX7XMSqLLhNcyANB3pAYERdHlD2rnPQZJocLFdEeFpLRFAAH0QhlgTrMaEmnzJD wHVUIv4cHPKqtdxffb8LJco8wWE+SRJKouyFvM1/8ApIZaWi6xO4DwrIHlNCVD3u 3uzTof+qKHnWVvjdTOM1M5V+kZVi4cOS+FT7UrCshOFGMOed9i2OCRvUjrJQWMfk 00LegT7+Gf+urjdL6qU+ZoM65gqPSIP3I5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddviedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeuudefje ejgffgtddtgeehgfekueevkeekieettedtkeffheeivdethfevffegueenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 Nov 2023 20:37:24 -0500 (EST) Message-ID: <2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com> Date: Sat, 11 Nov 2023 17:37:24 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Aren't regex_*() functions built-in? Content-Language: en-US To: pf@pfortin.com Cc: pgsql-general References: <20231111191214.60d182b2.pfortin@pfortin.com> <03377896-6a6c-435f-8a42-6f617f1adf22@aklaver.com> <20231111192548.55392ea9@pfortin.com> <20231111200417.539bebb0@pfortin.com> <152909a1-f984-4ff5-bb9e-6d2820aca26b@aklaver.com> <20231111202051.5f1f1acc@pfortin.com> From: Adrian Klaver In-Reply-To: <20231111202051.5f1f1acc@pfortin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/11/23 17:20, pf@pfortin.com wrote: > On Sat, 11 Nov 2023 17:10:29 -0800 Adrian Klaver wrote: > > > Actually, it's more eusbtle... I can make it work as "postgres"; but not > as a RO user (SELECT only): > An error occurred when executing the SQL command: > select * from a,b where regexp_replace(a.address,' ','','g') = regexp_replace(b.address,' ','','g') > > ERROR: permission denied for table a > 1 statement failed. > > I had no idea functions need permissions... GRANT EXTENSION..? 1) Functions do have permissions: https://www.postgresql.org/docs/current/ddl-priv.html EXECUTE Allows calling a function or procedure, including use of any operators that are implemented on top of the function. This is the only type of privilege that is applicable to functions and procedures. 2) This is not the problem here select * from a,b; would result in the same error. 3) This has nothing to do with extensions. > >>> ERROR: function regex_replace(text, unknown, unknown, unknown) does not >>> exist Hint: No function matches the given name and argument types. You >>> might need to add explicit type casts. Position: 27 >>> >>> Looks like rexexp_* need to be installed in each database I use... >>> >>> The question is how to use them from public where I get the above >>> error...? >>> >>> >> -- Adrian Klaver adrian.klaver@aklaver.com