Re: Dump SQL DDL of all functions in DB

From: Joe Conway <mail(at)joeconway(dot)com>
To: "Bradley Holbrook, Servillian Technology" <bholbrook(at)servillian(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Dump SQL DDL of all functions in DB
Date: 2011-08-09 15:25:27
Message-ID: 4E415167.3010901@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Diego Augusto Molina 2011-08-09 15:29:38 pg-8.4 dump database roles
Previous Message jtkells 2011-08-09 15:20:12 Re: PGDATA not accessible; please fix the directory permissions ($PGDATA should be world readable)