Thread: display function code

display function code

From
Colton A Smith
Date:
Hi:

   I wrote a function for my database and 'loaded' it, but then
misplaced the code.  Is there a query I can issue to retrieve it?

Thanks

Re: display function code

From
Bruce Momjian
Date:
Colton A Smith wrote:
> Hi:
>
>    I wrote a function for my database and 'loaded' it, but then
> misplaced the code.  Is there a query I can issue to retrieve it?

psql \df+?  That works for non-C languages.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: display function code

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Colton A Smith wrote:
>> I wrote a function for my database and 'loaded' it, but then
>> misplaced the code.  Is there a query I can issue to retrieve it?

> psql \df+?  That works for non-C languages.

Also, consider doing "pg_dump -s yourdb" and then pulling the CREATE
FUNCTION entry out of the dump script.

            regards, tom lane