agora inbox for pgsql-admin@postgresql.org
help / color / mirror / Atom feedFrom: lennam@incisivetechgroup.com
To: 'David G. Johnston' <david.g.johnston@gmail.com>
Cc: 'PABLO ANDRES IBARRA DUPRAT' <Pablo.Ibarra@itau.cl>
Cc: pgsql-admin@lists.postgresql.org
Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Date: Tue, 18 Jun 2024 16:31:27 -0400
Message-ID: <002f01dac1be$7fab9830$7f02c890$@incisivetechgroup.com> (raw)
In-Reply-To: <CAKFQuwb-g1f+dWPST3SFqQV6Mqu6d6MyieYxia6YoJpuRtDJgg@mail.gmail.com>
References: <CPUP152MB401802939E39B07A3BD264A887CE2@CPUP152MB4018.LAMP152.PROD.OUTLOOK.COM>
<CAKFQuwYLOipHt+=uto4RVyYaaJsYdLQFRDVF7Ct=WCFH7rvtqg@mail.gmail.com>
<CPUP152MB40187B6AFA1563A62AC5DF0F87CE2@CPUP152MB4018.LAMP152.PROD.OUTLOOK.COM>
<001401dac1b9$edd4aea0$c97e0be0$@incisivetechgroup.com>
<CAKFQuwb-g1f+dWPST3SFqQV6Mqu6d6MyieYxia6YoJpuRtDJgg@mail.gmail.com>
I provided the scripts , use , how ever you like
From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Tuesday, June 18, 2024 4:23 PM
To: lennam@incisivetechgroup.com
Cc: PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl>; pgsql-admin@lists.postgresql.org
Subject: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
On Tue, Jun 18, 2024 at 12:58 PM <lennam@incisivetechgroup.com <mailto:lennam@incisivetechgroup.com> > wrote:
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;'
Maybe using quote_ident to prevent, unlikely as it may be, SQL injection issues. The trims seem likely to be unnecessary - catalog contents should be clean.
Psql -h hostname -U ursename -d dbname -t -A -f mk_altr_proc_owner.sql -o altr_proc_owner.sql
The script output file is nice to check one's works I guess. But if you are going to use psql there is the \gexec meta-command that makes this even easier.
David J.
view thread (17+ messages) latest in thread
Message-ID: <002f01dac1be$7fab9830$7f02c890$@incisivetechgroup.com>
Permalink: ../002f01dac1be$7fab9830$7f02c890$@incisivetechgroup.com/
Also on: postgresql.org/message-id/002f01dac1be$7fab9830$7f02c890$@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, david.g.johnston@gmail.com, Pablo.Ibarra@itau.cl, pgsql-admin@lists.postgresql.org
Subject: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
In-Reply-To: <002f01dac1be$7fab9830$7f02c890$@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