My humble patch for pg_dump :-)

Поиск
Список
Период
Сортировка
От Constantin Teodorescu
Тема My humble patch for pg_dump :-)
Дата
Msg-id 36602806.1DBF47FB@flex.ro
обсуждение исходный текст
Список pgsql-hackers
Hello,

I am attaching here my humble patch for pg_dump utility modified by me
for readability purposes.

The main (and single) thing that is doing is changing the layout of
pg_dump'ed table structure by writing a single field per line so viewing
and changing the structure will be easier.

If you consider it useful, let it be included !

With my best regards,
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA*** ./bin/pg_dump/pg_dump.c.orig    Sat Nov 28 12:57:58 1998
--- ./bin/pg_dump/pg_dump.c    Sat Nov 28 13:15:35 1998
***************
*** 2622,2628 ****              becomeUser(fout, tblinfo[i].usename); 
!             sprintf(q, "CREATE TABLE %s (", fmtId(tblinfo[i].relname));             actual_atts = 0;             for
(j= 0; j < tblinfo[i].numatts; j++)             {
 
--- 2622,2628 ----              becomeUser(fout, tblinfo[i].usename); 
!             sprintf(q, "CREATE TABLE %s (\n\t", fmtId(tblinfo[i].relname));             actual_atts = 0;
for(j = 0; j < tblinfo[i].numatts; j++)             {
 
***************
*** 2634,2640 ****                     {                         sprintf(q, "%s%s%s char",
  q,
 
!                                 (actual_atts > 0) ? ", " : "",
fmtId(tblinfo[i].attnames[j]));                         sprintf(q, "%s(%d)",
 
--- 2634,2640 ----                     {                         sprintf(q, "%s%s%s char",
  q,
 
!                                 (actual_atts > 0) ? ", \n\t" : "",
fmtId(tblinfo[i].attnames[j]));                         sprintf(q, "%s(%d)",
 
***************
*** 2646,2652 ****                     {                         sprintf(q, "%s%s%s %s",
q,
 
!                                 (actual_atts > 0) ? ", " : "",
fmtId(tblinfo[i].attnames[j]),                                tblinfo[i].typnames[j]);
if(tblinfo[i].atttypmod[j]!= -1) {
 
--- 2646,2652 ----                     {                         sprintf(q, "%s%s%s %s",
q,
 
!                                 (actual_atts > 0) ? ", \n\t" : "",
fmtId(tblinfo[i].attnames[j]),                                tblinfo[i].typnames[j]);
if(tblinfo[i].atttypmod[j]!= -1) {
 
***************
*** 2665,2671 ****                         strcpy(id2, fmtId(tblinfo[i].typnames[j]));
sprintf(q,"%s%s%s %s",                                 q,
 
!                                 (actual_atts > 0) ? ", " : "",                                 id1,
             id2);                         actual_atts++;
 
--- 2665,2671 ----                         strcpy(id2, fmtId(tblinfo[i].typnames[j]));
sprintf(q,"%s%s%s %s",                                 q,
 
!                                 (actual_atts > 0) ? ", \n\t" : "",                                 id1,
                 id2);                         actual_atts++;
 
***************
*** 2682,2688 ****             {                 sprintf(q, "%s%s %s",                         q,
!                         (actual_atts + k > 0) ? ", " : "",                         tblinfo[i].check_expr[k]);
   } 
 
--- 2682,2688 ----             {                 sprintf(q, "%s%s %s",                         q,
!                         (actual_atts + k > 0) ? ", \n\t" : "",                         tblinfo[i].check_expr[k]);
       }  

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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: ecpg man page
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: Mysql 321 - Mysql 322 - msql