Re: [GSOC] questions about idea "rewrite pg_dump as library"

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Golub <pavel(at)gf(dot)microolap(dot)com>, Pavel Golub <pavel(at)microolap(dot)com>, ˧ <shuai900217(at)126(dot)com>, 'PostgreSQL-development' <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GSOC] questions about idea "rewrite pg_dump as library"
Date: 2013-04-11 16:00:28
Message-ID: 20130411160028.GH4361@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Andrew Dunstan (andrew(at)dunslane(dot)net) wrote:
> On 04/11/2013 09:51 AM, Tom Lane wrote:
> >No, this is exactly *wrong*. You might as well not bother to refactor,
> >if the only API the library presents is exactly equivalent to what you
> >could get with system("pg_dump ...").

Agreed.

> Well, either they want that or they want that output more
> accessibly, and without all the baggage that pg_dump necessarily
> brings to the table. pg_dump does a lot of stuff that's basically
> designed for bulk operations, and often what people want is a way to
> get, say, the creation DDL for some object, without any locks than
> the usual locks any transaction takes.

Yes- being able to get that from a simple database function would be
very nice. I wonder if some of what's been done with the "event"
triggers would inform us about what that API should look like.

> And yes, that would mean keeping knowledge of how to produce such
> output in two places - pg_dump is going to need to keep historical
> knowledge, for one thing. But I can live with that.

Agreed. If it doesn't live in two places, for some period, we'll never
actually have it outside of pg_dump.

> It could be interesting to have a library that would output database
> metadata in some machine readable and manipulatable format such as
> JSON or XML.

The DB function to produce the DDL command might have options to produce
it in multiple formats..? Seems like it'd be nice to have, though
perhaps not initially.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ants Aasma 2013-04-11 16:06:41 Re: Nearing beta?
Previous Message Mike Broers 2013-04-11 15:49:19 after 9.2.4 patch vacuumdb -avz not analyzing all tables