Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
От
David G. Johnston
Тема
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Дата
Msg-id
CAKFQuwbtpXWGjyi_6qmi3a1-j7kLKvkPpha2_QqjTSK71K9JEQ@mail.gmail.com
Ответ на
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER (Vitale, Anthony, Sony Music)
Список
Дерево обсуждения
Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER Tom Lane <tgl@sss.pgh.pa.us>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "Vitale, Anthony, Sony Music" <anthony.vitale@sonymusic.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER Ron Johnson <ronljohnsonjr@gmail.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER PABLO ANDRES IBARRA DUPRAT <Pablo.Ibarra@itau.cl>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER <lennam@incisivetechgroup.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER <lennam@incisivetechgroup.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER Ron Johnson <ronljohnsonjr@gmail.com>
Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER "David G. Johnston" <david.g.johnston@gmail.com>
On Tue, Jun 18, 2024 at 3:02 PM Vitale, Anthony, Sony Music <anthony.vitale@sonymusic.com> wrote:
I would this this is what you are looking for
For loops and SQL injection risks, not an ideal way to write SQL programs. Though it does allow you to avoid using psql but in which case you need to do away with the \set metacommands. If you are going to use psql I strongly suggest running the select query, inspecting the results, then changing said query to use \gexec. A lot fewer moving parts that dealing with plpgsql.
Good call on making it dynamic on prokind though. And the owner matching.
Tom's got the right idea of just casting the OID for the main naming scheme - it does the SQL injection mitigation.
David J.
В списке pgsql-admin по дате отправления