agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: lennam@incisivetechgroup.com
To: 'PABLO ANDRES IBARRA DUPRAT' <Pablo.Ibarra@itau.cl>
To: 'David G. Johnston' <david.g.johnston@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Date: Tue, 18 Jun 2024 15:58:44 -0400
Message-ID: <001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com> (raw)
In-Reply-To: <CPUP152MB40187B6AFA1563A62AC5DF0F87CE2@CPUP152MB4018.LAMP152.PROD.OUTLOOK.COM>
References: <CPUP152MB401802939E39B07A3BD264A887CE2@CPUP152MB4018.LAMP152.PROD.OUTLOOK.COM>
	<CAKFQuwYLOipHt+=uto4RVyYaaJsYdLQFRDVF7Ct=WCFH7rvtqg@mail.gmail.com>
	<CPUP152MB40187B6AFA1563A62AC5DF0F87CE2@CPUP152MB4018.LAMP152.PROD.OUTLOOK.COM>

 

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.Ibarra@itau.cl> 
Sent: Tuesday, June 18, 2024 3:47 PM
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-admin@lists.postgresql.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.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> > 
Enviado el: martes, 18 de junio de 2024 15:39
Para: PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl <mailto:Pablo.Ibarra@itau.cl> >
CC: pgsql-admin@lists.postgresql.org <mailto:pgsql-admin@lists.postgresql.org> 
Asunto: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

 

On Tuesday, June 18, 2024, PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl <mailto:Pablo.Ibarra@itau.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@itau.cl <mailto:seguridadinformacion@itau.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.

Attachments:

  [image/png] image001.png (29.7K, ../001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com/3-image001.png)
  download | view image

view thread (17+ messages)  latest in thread

Message-ID: <001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com>
Permalink:  ../001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com/
Also on:    postgresql.org/message-id/001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: lennam@incisivetechgroup.com, Pablo.Ibarra@itau.cl, david.g.johnston@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
  In-Reply-To: <001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox