retrieving a function? - Mailing list pgsql-general

From Cindy
Subject retrieving a function?
Date
Msg-id 14953.1010776823@attalus.tlg.uci.edu
Whole thread Raw
Responses Re: retrieving a function?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi, all.  I'm trying to recreate a function in one database to put
into another.

Text=# select * from pg_proc where proname = 'get_citation';

   proname    | proowner | prolang | proisinh | proistrusted |   proiscachable | pronargs | proretset | prorettype |
proargtypes| probyte_pct | properbyte_cpu | propercall_cpu |   prooutin_ratio |           prosrc
         | probin 
--------------+----------+---------+----------+--------------+---------------+-

---------+-----------+------------+-------------+-------------+----------------+----------------+----------------+--------------------------------------------------------------------------+--------
 get_citation |     3899 |      14 | f        | t            | f   |        3 | t         |1043 |    21 21 23 |
100|              0 |              0 |   100 | select citation from citations where aid= $1 and wid= $2 and byteloc=$3
|- 


But I'm not quite sure how to make use of this info.  It looks like
there are three arguments, but I don't know what their names or types
are.  When I look up the create function in the online reference
manual, there's no examples showing the use of the $1 and $2.  I'm not
even entirely certain of what this function returns.

I thought of trying to dump the function so as to have it from that,
but there doesn't seem to be a utility to just dump functions.  It
sounded from the documentation on dump_pg that if one dumped a table,
all the related functions would be dumped too, so I dumped citations
but did not get the functions.  I'm reluctant to dump the entire db
Text because it's way too big (citations.dump alone is 300M).

Surely there's an easier way to reconstruct this function?

Thanks,
--Cindy
--
ctmoore@uci.edu

pgsql-general by date:

Previous
From: Frank Joerdens
Date:
Subject: Does pg_dumpall do BLOBs too?
Next
From: Sam Tregar
Date:
Subject: ANN: Bricolage Content-Management and Publishing System 1.2.0