RE: extracting the sql for a function

Поиск
Список
Период
Сортировка
От Charles Clavadetscher
Тема RE: extracting the sql for a function
Дата
Msg-id 03a101d43b12$7f1f12e0$7d5d38a0$@swisspug.org
обсуждение исходный текст
Ответ на extracting the sql for a function  (Paul Tilles <paul.tilles@noaa.gov>)
Ответы Re: extracting the sql for a function  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
Hello

> -----Original Message-----
> From: Paul Tilles [mailto:paul.tilles@noaa.gov]
> Sent: Donnerstag, 23. August 2018 19:18
> To: pgsql-general@postgresql.org
> Subject: extracting the sql for a function
> 
> Using postgres Version 9.5
> 
> I can extract the sql for a table using
> 
> pg_dump  -d database_name  -s  -t  table_name  -f  table_name.sql
> 
> Is there something equivalent for extracting the sql for a function from the database?
> 
> 
> Paul Tilles
> 

I don't know if there is but you can get the function definition:

SELECT * FROM pg_get_functiondef('functionname'::regproc);

or

SELECT * FROM pg_get_functiondef('functionname(list of parameters data types)'::regprocedure);

If you want to export you may use the -t and -o switches.

Regards
Charles




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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Upgrade/Downgrade
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: extracting the sql for a function