Search Postgresql Archives

RE: extracting the sql for a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

> -----Original Message-----
> From: Paul Tilles [mailto:paul.tilles@xxxxxxxx]
> Sent: Donnerstag, 23. August 2018 19:18
> To: pgsql-general@xxxxxxxxxxxxxx
> 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux