Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Дата
Msg-id CANzqJaC6JzkodOS51EAKf0nxvRGEToTPyPKomYH4z9CfO1JZow@mail.gmail.com
обсуждение исходный текст
Ответ на 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
Список pgsql-admin
On Tue, Jun 18, 2024 at 3:33 PM PABLO ANDRES IBARRA DUPRAT <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.


This isn't perfect, because of the curly braces, but it's a start.
select format('ALTER PROCEDURE %s (%s) OWNER TO foo;',
              pronamespace::regnamespace||'.'||proname
            , proargnames)
from pg_proc
where pronamespace::regnamespace = 'some_schema';


Once the query returns the proper commands, execute it by replacing the terminating ";" with "\gexec".

В списке pgsql-admin по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Следующее
От:
Дата:
Сообщение: RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER