Search Postgresql Archives

Re: get source of udf

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

 



Hello

postgres=# select pg_get_functiondef('fx'::regproc);
                pg_get_functiondef
--------------------------------------------------
 CREATE OR REPLACE FUNCTION public.fx(_m integer)+
  RETURNS void                                   +
  LANGUAGE plpgsql                               +
 AS $function$                                   +
 declare m double precision = 10;                +
         n double precision = 20022.222;         +
   r double precision;                           +
 begin                                           +
   for i in 1.._m                                +
   loop                                          +
     r := m * n;                                 +
   end loop;                                     +
 end;                                            +
 $function$                                      +

(1 row)

regards

Pavel Stehule

2012/11/20 Peter Kroon <plakroon@xxxxxxxxx>:
> Hi list,
>
> I would like to get the source of a udf.
> In mssql I run this query:
> SELECT OBJECT_DEFINITION(OBJECT_ID) FROM sys.objects WHERE
> name='function_name';
> And I get the entire source of the function.
>
> How must I do this in PostgreSQL?
>
> Thanks,
> Peter


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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