From bholbrook@servillian.com Thu Aug 4 00:08:48 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5C27FB5D80A for ; Wed, 3 Aug 2011 21:08:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 22248-02 for ; Thu, 4 Aug 2011 00:08:41 +0000 (UTC) X-Greylist: delayed 00:32:14.635888 by SQLgrey-1.7.6 Received: from unix1.servillianhosting.com (unix1.servillianhosting.com [208.71.168.20]) by mail.postgresql.org (Postfix) with ESMTP id EA68CB5D944 for ; Wed, 3 Aug 2011 21:08:40 -0300 (ADT) Received: from s01060026f32d4ae8.ok.shawcable.net ([24.67.61.104] helo=BradleyHolbrook) by unix1.servillianhosting.com with esmtp (Exim 4.69) (envelope-from ) id 1Qokz8-0001qC-8G for pgsql-admin@postgresql.org; Wed, 03 Aug 2011 16:36:22 -0700 From: "Bradley Holbrook, Servillian Technology" To: Subject: Dump SQL DDL of all functions in DB Date: Wed, 3 Aug 2011 16:35:59 -0700 Message-ID: <044501cc5236$1b376ab0$51a64010$@servillian.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0446_01CC51FB.6EDADCA0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcxSNd1WwPrbwFgLSta69U1c2YsJ4A== Content-Language: en-ca X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - unix1.servillianhosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - servillian.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, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201108/43 X-Sequence-Number: 38030 This is a multipart message in MIME format. ------=_NextPart_000_0446_01CC51FB.6EDADCA0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Bradley A Holbrook Sr. Web Developer Servillian Technology Ltd http://www.servillian.com bholbrook@servillian.com bholbrook@telus.blackberry.net Cell: (250) 309 - 7408 Office: (250) 260 - 4351 ext. 13 ************************************* For up to the minute news, support notifications and other pertinant information regarding your website or related services, you can use the following resources: Twitter | Facebook | Support Website ------=_NextPart_000_0446_01CC51FB.6EDADCA0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

 

Bradley A Holbrook

Sr. Web Developer

Servillian Technology Ltd

 

http://www.servillian.com

bholbrook@servillian.com

bholbrook@telus.blackberry.net=

Cell:       (250) 309 – = 7408

Office: (250) 260 – 4351 ext. 13

 

*************************************

For up to the minute news, support notifications and other = pertinant information regarding your website or related services, you = can use the following resources:

 

Twitter | Facebook | Support Website

 

------=_NextPart_000_0446_01CC51FB.6EDADCA0-- From mail@joeconway.com Tue Aug 9 15:25:35 2011 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 From gsievers19@comcast.net Tue Aug 9 15:55:48 2011 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 51370B5DC40 for ; Tue, 9 Aug 2011 12:55:48 -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 56211-01-3 for ; Tue, 9 Aug 2011 15:55:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qmta06.westchester.pa.mail.comcast.net (qmta06.westchester.pa.mail.comcast.net [76.96.62.56]) by mail.postgresql.org (Postfix) with ESMTP id 5C759B5DC48 for ; Tue, 9 Aug 2011 12:55:41 -0300 (ADT) Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta06.westchester.pa.mail.comcast.net with comcast id JCR71h0081wpRvQ56FvhlA; Tue, 09 Aug 2011 15:55:41 +0000 Received: from homie ([68.45.149.190]) by omta18.westchester.pa.mail.comcast.net with comcast id JFvh1h00246izrY3eFvhqo; Tue, 09 Aug 2011 15:55:41 +0000 Received: by homie (Postfix, from userid 1000) id C3936181A58; Tue, 9 Aug 2011 11:55:39 -0400 (EDT) To: "Bradley Holbrook\, Servillian Technology" Cc: Subject: Re: Dump SQL DDL of all functions in DB References: <044501cc5236$1b376ab0$51a64010$@servillian.com> From: Jerry Sievers Date: Tue, 09 Aug 2011 11:55:39 -0400 In-Reply-To: <044501cc5236$1b376ab0$51a64010$@servillian.com> (Bradley Holbrook's message of "Wed\, 3 Aug 2011 16\:35\:59 -0700") Message-ID: <8739hay3yc.fsf@comcast.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.682 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1.929, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.812 X-Spam-Level: X-Archive-Number: 201108/59 X-Sequence-Number: 38046 "Bradley Holbrook, Servillian Technology" writes: > 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 select pg_get_functiondef(p.oid) || ';' from pg_proc p join pg_namespace n on p.pronamespace = n.oid where n.nspname = 'public' ; psql -Atq -f... HTH > Bradley A Holbrook > > Sr. Web Developer > > Servillian Technology Ltd > > http://www.servillian.com > > bholbrook@servillian.com > > bholbrook@telus.blackberry.net > > Cell: (250) 309 ó 7408 > > Office: (250) 260 ó 4351 ext. 13 > > ************************************* > > For up to the minute news, support notifications and other pertinant information regarding your website or related > services, you can use the following resources: > > Twitter | Facebook | Support Website > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 305.321.1144