Skip site navigation (1) Skip section navigation (2)

Re: View user defined functions

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Charley L(dot) Tiggs" <ctiggs(at)xpressdocs(dot)com>
Cc: Postgres Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: View user defined functions
Date: 2005-10-18 15:06:30
Message-ID: 20051018150630.GA78121@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-novice
On Tue, Oct 18, 2005 at 09:43:51AM -0500, Charley L. Tiggs wrote:
> How can I see the definition of a user defined function without  
> dumping the database or the schema to a file?  I've been looking for  
> a way to do this for about three weeks now, off and on and it's  
> getting rather tedious to need to dump the schema every time I wish  
> to change some part of a function.

In psql you can use "\df+ functionname"; you could also issue a
query like

SELECT prosrc FROM pg_proc WHERE proname = 'functionname';

Note that neither of these methods returns the complete CREATE
FUNCTION statement that you might be looking for.

Some people maintain the source for their functions outside the
database so they can do "edit-load" instead of "dump-edit-load."

-- 
Michael Fuhr

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2005-10-18 15:39:30
Subject: Re: View user defined functions
Previous:From: Charley L. TiggsDate: 2005-10-18 14:43:51
Subject: View user defined functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group