Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F1173B5DC28 for ; Tue, 9 Aug 2011 12:25:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 80759-06-4 for ; Tue, 9 Aug 2011 15:25:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from joeconway.com (wsip-72-214-29-243.sd.sd.cox.net [72.214.29.243]) by mail.postgresql.org (Postfix) with ESMTP id 8E589B5DC08 for ; Tue, 9 Aug 2011 12:25:29 -0300 (ADT) Received: from www.joeconway.com (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 11251936; Tue, 09 Aug 2011 08:25:27 -0700 Message-ID: <4E415167.3010901@joeconway.com> Date: Tue, 09 Aug 2011 08:25:27 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.5.0.12-3.fc6 pango-text Thunderbird/1.5.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: "Bradley Holbrook, Servillian Technology" CC: pgsql-admin@postgresql.org Subject: Re: Dump SQL DDL of all functions in DB References: <044501cc5236$1b376ab0$51a64010$@servillian.com> In-Reply-To: <044501cc5236$1b376ab0$51a64010$@servillian.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201108/54 X-Sequence-Number: 38041 On 08/03/2011 04:35 PM, Bradley Holbrook, Servillian Technology wrote: > Anyone know how to dump the DDL of every function in a schema into one file? > > Essentially, I’d like to do something like: > > ‘functions ddl dump cmd’ public functions.sql The easiest way is probably to do a schema-only dump and then edit the result to eliminate everything you don't want. E.g.: pg_dump --schema-only --schema=foobar test Note that "--schema-only" means object definitions without data whereas "--schema=foobar" is saying to only consider objects in the schema called foobar. The work "schema" here has two different meanings. HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support