Re: Schema renaming cascade

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Lorusso Domenico <domenico(dot)l76(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Schema renaming cascade
Date: 2023-08-17 15:54:45
Message-ID: 20230817155445.lr33wx2eupzu2eqf@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2023-Aug-17, Lorusso Domenico wrote:

> Hello guys,
> I need to rename a schema, including each reference to it (also for
> functions)

Maybe you should consider removing schema name references in function
source code, and instead refer to the tables (and other functions, etc)
by their unqualified names, and at the same time attach a "SET
search_path" clause to the function. That way, when you need to rename
the schema you don't need to change the function source code, just
update its "SET search_path" clause.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2023-08-17 16:34:20 Re: Fatal Error : Invalid Memory alloc request size 1236252631
Previous Message Pavel Stehule 2023-08-17 15:54:22 Re: Re: Fatal Error : Invalid Memory alloc request size 1236252631