Schema/ROLE Rename Issue

Started by Brajendra Pratap Singhover 5 years ago3 messagesgeneral
Jump to latest
#1Brajendra Pratap Singh
singh.bpratap766@gmail.com

Hi,

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.

Thanks and Regards,
Brajendra

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Brajendra Pratap Singh (#1)
Re: Schema/ROLE Rename Issue

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

#3Brajendra Pratap Singh
singh.bpratap766@gmail.com
In reply to: Laurenz Albe (#2)
Re: Schema/ROLE Rename Issue

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:

Show quoted text

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