Re: deparsing utility commands - Mailing list pgsql-hackers

From Ryan Pedela
Subject Re: deparsing utility commands
Date
Msg-id CACu89FTn23NKLcFbgo57u7BAy8fXFE2vwucEHJD2F7n92VLerw@mail.gmail.com
Whole thread Raw
In response to Re: deparsing utility commands  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Tue, Feb 24, 2015 at 6:48 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Stephen Frost wrote:

I'm thinking something like
 SELECT * FROM pg_creation_commands({'pg_class'::regclass, 'sometable'::pg_class});
would return a set of commands in the JSON-blob format that creates the
table.  The input argument is an array of object addresses, so that you
can request creation commands for multiple objects.  (It's not my
intention to provide this functionality right away, but if somebody else
wants to work on top of the current deparse patch, by my guest; if it
proves simple enough we can still get it into 9.5 as part of this
patch.)

 +1

Another possible function could be to diff two relations to produce a set of DDL commands that could be used for schema migrations.

Also thank you very much! CREATE/ALTER support in event triggers is the upcoming feature I am most excited about, and I am happy to see progress.

Thanks,
Ryan Pedela 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_dump gets attributes from tables in extensions
Next
From: Corey Huinker
Date:
Subject: Re: Partitioning WIP patch (was: Partitioning: issues/ideas)