Re: Schema/ROLE Rename Issue - Mailing list pgsql-general

From Brajendra Pratap Singh
Subject Re: Schema/ROLE Rename Issue
Date
Msg-id CAFD-joOELFMYc1HxUV5naqS-6Ua7gRh=TZy0u3H+tsYB9-Mdvg@mail.gmail.com
Whole thread Raw
In response to Schema/ROLE Rename Issue  (Brajendra Pratap Singh <singh.bpratap766@gmail.com>)
List pgsql-general
Thank you Albe..

Could u plz suggest me the best way to get the definition of functions via connecting through psql as while I am trying to change the definition through \ef function_name it won't reflect the changes.

Thanks
Brajendra

On Wed, 9 Sep, 2020, 7:39 PM Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
On Wed, 2020-09-09 at 17:04 +0530, Brajendra Pratap Singh wrote:
> Recently we had renamed schema and role but it will not get reflect in the object definitions ,plz suggest.
>
> OLD SCHEMA/ROLE  -  TEST11
> NEW SCHEMA/ROLE -  TEST
>
> But still we are that TEST11 is present in the definition of sone objects like procudure,functions,triggers etc, so how can we modify the name from TEST11  to TEST in definition.
>

You cannot habe that automatically.

While in view and index definitions as well as column default clauses,
the internal object identifier is used, so that renaming doesn't break
anything, functions are stored as string literals and parsed at
execution time.

You'll have to edit all your functions (or undo the renaming).

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Autovacuum of independent tables
Next
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: BUG? Slave don't reconnect to the master