How to view the code in a function??

Started by Callis, Adamover 25 years ago3 messagesgeneral
Jump to latest
#1Callis, Adam
acallis@UU.NET

Hello,
I am sure someone probably knows this, I have used the \d tablename quite a
lot lately, but I was wondering how to view the code in a function. Is there
a way to get the definition?

thanks
adam

#2GH
grasshacker@over-yonder.net
In reply to: Callis, Adam (#1)
Re: How to view the code in a function??

On Tue, Nov 28, 2000 at 02:43:08PM -0500, some SMTP stream spewed forth:

Hello,
I am sure someone probably knows this, I have used the \d tablename quite a
lot lately, but I was wondering how to view the code in a function. Is there
a way to get the definition?

I assume you are using '\d' in psql.

Add the '-E' option when you start psql and it will show the specific
commands that it uses to expand things like '\d'.

It is a bit messy, though.

gh

Show quoted text

thanks
adam

#3Ashley Clark
aclark@ghoti.org
In reply to: Callis, Adam (#1)
Re: How to view the code in a function??

* Callis, Adam in "[GENERAL] How to view the code in a function??"
* dated 2000/11/28 14:43 wrote:

Hello,

Hi,

I am sure someone probably knows this, I have used the \d tablename
quite a lot lately, but I was wondering how to view the code in a
function. Is there a way to get the definition?

Try this select statement:

SELECT pg_proc.proname, pg_proc.prosrc
FROM pg_proc, pg_user
WHERE ((pg_proc.proowner = pg_user.usesysid) AND
(pg_user.usename = 'username'::name));

This will return the function names and source to functions defined by
user specified in username.

--
shaky recall