From: | Shuai Fan <shuai900217(at)126(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Pavel Golub <pavel(at)gf(dot)microolap(dot)com>, 'PostgreSQL-development' <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [GSOC] questions about idea "rewrite pg_dump as library" |
Date: | 2013-04-12 10:34:42 |
Message-ID: | 5167E342.7010301@126.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 04/11/2013 11:48 PM, Andrew Dunstan wrote:
> 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. One thing that's annoying about the text output pg_dump
> produces is that it's not at all structured, so if you want, for
> example, to restore a table but to a table of a different name, or to
> a different schema, then you're reduced to having to mangle the SQL by
> using hand editing or regular expression matching. Something with the
> potential to ease that pain would be worth having.
>
Yes. This is really interesting. Current code in pg_dump, supports 4
ArchiveFormat, e.g. archCustom, archTar, archNull and archDirectory.
These formats are implementation of interface "pg_backup". Maybe I could
try to add two implementation of "XML" and "JSON".
It is worth to mention that I wrote a program to parse XML format
file into csv one using library "libxercesc" a month ago, Although, this
program is just like helloworld. But, maybe I could get benefit from
that small program, because both of them use XML format. And what I need
to do is try another xml library.
I had a look at JSON on wiki. The format is a little like XML. Both
of them are nested. And there are some library could be used, e.g.
libjson (or json.c, or other json library writting in C) and libxml2 (or
something else).
BTW, could it be an idea for GSOC? If so, I can have a try. Add XML
and JSON output format for pg_dump.
Thank you all for your attention.
Best regards,
Shuai
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2013-04-12 10:57:19 | Re: Inconsistent DB data in Streaming Replication |
Previous Message | Dimitri Fontaine | 2013-04-12 09:50:39 | Re: [GSOC] questions about idea "rewrite pg_dump as library" |