Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 798721337C0D for ; Mon, 2 May 2011 14:24:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 12356-07-2 for ; Mon, 2 May 2011 17:24:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id E7608133798E for ; Mon, 2 May 2011 14:23:54 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QGwqb-0007R3-U5 for pgsql-admin@postgresql.org; Mon, 02 May 2011 19:23:49 +0200 Received: from ppp-93-104-191-172.dynamic.mnet-online.de ([93.104.191.172]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2011 19:23:49 +0200 Received: from spam_eater by ppp-93-104-191-172.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2011 19:23:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Thomas Kellerer Subject: Re: OID for pg_get_functiondef Date: Mon, 02 May 2011 19:23:41 +0200 Lines: 18 Message-ID: References: <5sntr656p8qf7se8s74m80330kaoogs93a@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ppp-93-104-191-172.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <5sntr656p8qf7se8s74m80330kaoogs93a@4ax.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201105/11 X-Sequence-Number: 37448 jtkells@verizon.net wrote on 02.05.2011 18:52: > I've just started working on an 8.4 database and I have been asked to > extract all the functions source code stored in various databases and > schemas so they can be put into a repository for the developers. I'm > planning to use pg_get_functiondef(OID) but I am having a hard time > finding the OID for functions. I've looked into the > information_schema and the pg_catalog schemas and have found > information on functions but none of them seem to have the OID of the > function. Can anyone please tell how to get the OID for a function > within a schema and or if there is a better way. > > Thanks > select pg_function_def(oid) from pg_proc where proname = 'your_function'