Re: Changing a schema's name with function1 calling function2 - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Changing a schema's name with function1 calling function2
Date
Msg-id 90ca8707-6f44-47c2-b781-0138947d7483@aklaver.com
Whole thread Raw
In response to Re: Re: Changing a schema's name with function1 calling function2  ("Wilma Wantren" <wilma.wantren@eclipso.de>)
Responses Re: Changing a schema's name with function1 calling function2  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
List pgsql-general
On 12/23/23 08:12, Wilma Wantren wrote:
> Thank you!
> I had already feared that such a variable does not exist (because I had not found it). I think that's a pity, because
Isuspect that in at least 90% of the cases where a function needs a search_path, this variable would be the value of
thesearch_path, so that in 90% of the cases no change to the search_path would be necessary after renaming the schema.
 

I would say the issue is with this from your previous post:


"Therefore it would be great if there was a variable which I could set 
in a search_path (like the variable "$user") which denotes the 
function's schema and which is only evaluated when the function is 
executed, i.e. the variable would be the value of the function's 
search_path in the function's meta data."

search_path can be set(just off the top of head):

postgresql.conf and it's include files
ALTER DATABASE
ALTER FUNCTION
ALTER ROLE
ALTER SYSTEM
At any point by a user/script/function/etc.

Even if such a variable existed you be chasing down the 'correct' 
version of search_path that had it. Basically where you are now.

> Many thanks for the reference to sqitch, I'll have a look at that now.
>   
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




pgsql-general by date:

Previous
From: "Wilma Wantren"
Date:
Subject: Re: Re: Changing a schema's name with function1 calling function2
Next
From: Adrian Klaver
Date:
Subject: Re: Unable to start postgresql-14