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

Поиск
Список
Период
Сортировка
От Shuai Fan
Тема Re: [GSOC] questions about idea "rewrite pg_dump as library"
Дата
Msg-id 5167E342.7010301@126.com
обсуждение исходный текст
Ответ на Re: [GSOC] questions about idea "rewrite pg_dump as library"  (Andrew Dunstan <andrew@dunslane.net>)
Список 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






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: [GSOC] questions about idea "rewrite pg_dump as library"
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Inconsistent DB data in Streaming Replication