RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

From: <lennam(at)incisivetechgroup(dot)com>
To: "'PABLO ANDRES IBARRA DUPRAT'" <Pablo(dot)Ibarra(at)itau(dot)cl>, "'David G(dot) Johnston'" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Date: 2024-06-18 19:58:44
Message-ID: 001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Following scripts will take care to change schema owner

Mk_altr_proc_owner.sql ( copy past this SQL statement)

SELECT ' alter procedure '||rtrim(nspname)||'.'||ltrim( proname )||' owner to targetschema;'

FROM pg_catalog.pg_namespace

JOIN pg_catalog.pg_proc

ON pronamespace = pg_namespace.oid

WHERE nspname = 'yourschemaname

ORDER BY Proname ;

Psql -h hostname -U ursename -d dbname -t -A -f mk_altr_proc_owner.sql -o altr_proc_owner.sql

Psql -h hostname -U username -d dbname -f altr_proc_woner.sql -o alter_proc_owner.log

--Raju

From: PABLO ANDRES IBARRA DUPRAT <Pablo(dot)Ibarra(at)itau(dot)cl>
Sent: Tuesday, June 18, 2024 3:47 PM
To: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

Hi David,

Why do you say that reassined operation don’t work for me?

This operation is for assign an account for execute all modifications required over the environment.

Greetings

De: David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com <mailto:david(dot)g(dot)johnston(at)gmail(dot)com> >
Enviado el: martes, 18 de junio de 2024 15:39
Para: PABLO ANDRES IBARRA DUPRAT <Pablo(dot)Ibarra(at)itau(dot)cl <mailto:Pablo(dot)Ibarra(at)itau(dot)cl> >
CC: pgsql-admin(at)lists(dot)postgresql(dot)org <mailto:pgsql-admin(at)lists(dot)postgresql(dot)org>
Asunto: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

On Tuesday, June 18, 2024, PABLO ANDRES IBARRA DUPRAT <Pablo(dot)Ibarra(at)itau(dot)cl <mailto:Pablo(dot)Ibarra(at)itau(dot)cl> > wrote:

Hi Dear Community.

I need your help with advices about the way to script a SQL command to generate a list of ALTER PROCEDURE and change owner of a big number of procedures.

As you know to identify the procedure or function is neccesary to add to the name of routine and list of parameters with their data type in each case.

Please any advice Will be appreciate.

Have you determined that “reassigned owned” won’t work for you?

David J.

ADVERTENCIA: E-Mail externo, favor verifique remitente, no descargue archivos adjuntos de remitentes desconocidos, no haga Clic en enlaces. Ante sospechas reporte a Seguridad de Información Itau seguridadinformacion(at)itau(dot)cl <mailto:seguridadinformacion(at)itau(dot)cl>

Para asegurar la adecuada lectura en todo tipo de correos electronicos, se han omitido intencionalmente los signos y acentos diacriticos del idioma castellano. La informacion contenida en este mensaje y cualquier archivo adjunto es confidencial y no puede ser usada por mas personas que sus destinatarios. El uso no autorizado de esta informacion puede ser sancionado de conformidad con el Codigo Penal chileno. Si ha recibido este correo por error, por favor notifique al remitente respondiendo este mismo mensaje y elimine el mensaje y todos los archivos adjuntos. Internet no puede garantizar la integridad de este mensaje, por lo que el Banco no se hace responsable si el contenido del mismo ha sido alterado.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2024-06-18 20:22:45 Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Previous Message PABLO ANDRES IBARRA DUPRAT 2024-06-18 19:47:02 RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER