dbTalk Databases Forums  

viewing function source code

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss viewing function source code in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pradeepkumar, Pyatalo
 
Posts: n/a

Default viewing function source code - 08-31-2004 , 12:54 AM







Hi all,

I am using Postgresql 7.4.3 on Linux 7.2.
In my project i am using many user defined functions. All the functions are
working fine, no problem with the working. I had stored all the functions in
the /home/postgres folder on the linux machine. I used psql -f -filename
-databasename command to run the functions. Last night, I accidentally
deleted the source files from the /home/postgres folder. I dont have the
backup of these functions. However these functions are working fine. Is
there a way to view the sourcecode of the functions from the database.
When I type the command,

eps_db=# \df

it gives the list of all the functions used in the database(eps_db),
arguments passed and the function return type. Is there a way wherein I can
look into the function sourcecode from within the database.

Thanks in advance.

Quote:
With Best Regards
Pradeep Kumar P J


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: viewing function source code - 08-31-2004 , 12:59 AM






"Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo (AT) honeywell (DOT) com> writes:
Quote:
Is there a way wherein I can
look into the function sourcecode from within the database.
\df+ ... but really what you want to do is run pg_dump (possibly with -s
option) to extract the function definitions in a reloadable form.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



Reply With Quote
  #3  
Old   
Pradeepkumar, Pyatalo
 
Posts: n/a

Default Re: viewing function source code - 08-31-2004 , 01:28 AM




That worked, Thanks a lot Tom.


-----Original Message-----
From: Tom Lane [mailto:tgl (AT) sss (DOT) pgh.pa.us]
Sent: Tuesday, August 31, 2004 11:30 AM
To: Pradeepkumar, Pyatalo (IE10)
Cc: pgsql-novice (AT) postgresql (DOT) org
Subject: Re: [NOVICE] viewing function source code


"Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo (AT) honeywell (DOT) com> writes:
Quote:
Is there a way wherein I can
look into the function sourcecode from within the database.
\df+ ... but really what you want to do is run pg_dump (possibly with -s
option) to extract the function definitions in a reloadable form.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.