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" <anthony.vitale@sonymusic.com>)
Список pgsql-admin
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 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: RE: Materialized views & dead tuples
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Statement_timeout in procedure block