pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pf@pfortin.com
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Aren't regex_*() functions built-in?
Date: Sat, 11 Nov 2023 17:37:24 -0800
Message-ID: <2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com> (raw)
In-Reply-To: <20231111202051.5f1f1acc@pfortin.com>
References: <20231111191214.60d182b2.pfortin@pfortin.com>
	<03377896-6a6c-435f-8a42-6f617f1adf22@aklaver.com>
	<20231111192548.55392ea9@pfortin.com>
	<a479d6c0-b7eb-46ab-bb82-fc23774556da@aklaver.com>
	<20231111200417.539bebb0@pfortin.com>
	<152909a1-f984-4ff5-bb9e-6d2820aca26b@aklaver.com>
	<20231111202051.5f1f1acc@pfortin.com>

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






view thread (12+ messages)  latest in thread

Message-ID: <2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com>
Permalink:  ../2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com/
Also on:    postgresql.org/message-id/2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, pf@pfortin.com
  Subject: Re: Aren't regex_*() functions built-in?
  In-Reply-To: <2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com>
  References: <20231111191214.60d182b2.pfortin@pfortin.com> <03377896-6a6c-435f-8a42-6f617f1adf22@aklaver.com> <20231111192548.55392ea9@pfortin.com> <a479d6c0-b7eb-46ab-bb82-fc23774556da@aklaver.com> <20231111200417.539bebb0@pfortin.com> <152909a1-f984-4ff5-bb9e-6d2820aca26b@aklaver.com> <20231111202051.5f1f1acc@pfortin.com> <2ba1af33-b3ad-4a4a-9143-9d644af26d66@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox