From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Wilma Wantren <wilma.wantren@eclipso.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Changing a schema's name with function1 calling function2
Date: Sat, 23 Dec 2023 08:31:39 -0800
Message-ID: <90ca8707-6f44-47c2-b781-0138947d7483@aklaver.com> (raw)
In-Reply-To: <09a7102b697d2b2acd81cb12344b0170@mail.eclipso.de>
References: <9ed1070f8561f048e72c3a3683565d97@mail.eclipso.de>
<07aac10034aaf87697ae401475f48909@mail.eclipso.de>
<aa3e044d-f688-4f91-b6c4-570c0cec96f1@aklaver.com>
<4cb2e7242b54e84f9d0c161cc56f38e4@mail.eclipso.de>
<f09b9fb9-98b9-4d39-a47b-c32ca3ff8782@aklaver.com>
<09a7102b697d2b2acd81cb12344b0170@mail.eclipso.de>
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 I suspect that in at least 90% of the cases where a function needs a search_path, this variable would be the value of the search_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
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, wilma.wantren@eclipso.de
Subject: Re: Changing a schema's name with function1 calling function2
In-Reply-To: <90ca8707-6f44-47c2-b781-0138947d7483@aklaver.com>
References: <9ed1070f8561f048e72c3a3683565d97@mail.eclipso.de> <07aac10034aaf87697ae401475f48909@mail.eclipso.de> <aa3e044d-f688-4f91-b6c4-570c0cec96f1@aklaver.com> <4cb2e7242b54e84f9d0c161cc56f38e4@mail.eclipso.de> <f09b9fb9-98b9-4d39-a47b-c32ca3ff8782@aklaver.com> <09a7102b697d2b2acd81cb12344b0170@mail.eclipso.de> <90ca8707-6f44-47c2-b781-0138947d7483@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