Re: How to dump JUST procedures/funnctions?

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: How to dump JUST procedures/funnctions?
Дата
Msg-id 20100320081646.GA26868@tux
обсуждение исходный текст
Ответ на How to dump JUST procedures/funnctions?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Ответы Re: How to dump JUST procedures/funnctions?  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
Список pgsql-general
Carlo Stonebanks <stonec.register@sympatico.ca> wrote:

> I'd like to dump to text the full SQL required to create/replace all
> user-defined functions within a specific schema - but JUST the function
> declarations.
>
> We are doing server migration and there are some network paths in the
> code I would like to search and replace.

All functions are stored in pg_catalog.pg_proc, you can search the
column prosrc for your network paths.

And you can get the whole function-definition with pg_get_functiondef.


Okay. Now you can run this select:

select 'select pg_get_functiondef (' || oid || ');' from pg_proc where prosrc ~ 'network path';

The result can you use to run as commands to retrieve all
function-definitions.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Carlo Stonebanks"
Дата:
Сообщение: How to dump JUST procedures/funnctions?
Следующее
От: Deepa Thulasidasan
Дата:
Сообщение: Transaction table