Re: PQprint under Windows - Mailing list pgsql-interfaces

From Bruce Momjian
Subject Re: PQprint under Windows
Date
Msg-id 200602070123.k171NRA27993@candle.pha.pa.us
Whole thread Raw
In response to Re: PQprint under Windows  (Christoph Zwerschke <cito@online.de>)
Responses Re: PQprint under Windows
List pgsql-interfaces
Christoph Zwerschke wrote:
> >> I also noticed that the HTML code in PQprint is not very clean and
> >> sometimes even wrong, e.g. it has <centre> instead of <center>.
> >
> > Fixed in 8.1.X.
>
> As already mentioned, there is also a wrong attribute align=high and as
> I just saw, also align=left and align=right attributes without quotes.

Here is the patchI applied based on your report.  I already fixed the
"centre" cases.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/interfaces/libpq/fe-print.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v
retrieving revision 1.65
diff -c -c -r1.65 fe-print.c
*** src/interfaces/libpq/fe-print.c    6 Feb 2006 02:23:07 -0000    1.65
--- src/interfaces/libpq/fe-print.c    7 Feb 2006 00:23:54 -0000
***************
*** 256,262 ****
              {
                  if (po->html3)
                      fprintf(fout,
!                             "<table %s><caption align=high>%d</caption>\n",
                              po->tableOpt ? po->tableOpt : "", i);
                  else
                      fprintf(fout, libpq_gettext("-- RECORD %d --\n"), i);
--- 256,262 ----
              {
                  if (po->html3)
                      fprintf(fout,
!                             "<table %s><caption align=\"top\">%d</caption>\n",
                              po->tableOpt ? po->tableOpt : "", i);
                  else
                      fprintf(fout, libpq_gettext("-- RECORD %d --\n"), i);
***************
*** 276,287 ****
                  {
                      if (po->caption)
                          fprintf(fout,
!                               "<table %s><caption align=high>%s</caption>\n",
                                  po->tableOpt ? po->tableOpt : "",
                                  po->caption);
                      else
                          fprintf(fout,
!                                 "<table %s><caption align=high>"
                                  "Retrieved %d rows * %d fields"
                                  "</caption>\n",
                             po->tableOpt ? po->tableOpt : "", nTups, nFields);
--- 276,287 ----
                  {
                      if (po->caption)
                          fprintf(fout,
!                               "<table %s><caption align=\"top\">%s</caption>\n",
                                  po->tableOpt ? po->tableOpt : "",
                                  po->caption);
                      else
                          fprintf(fout,
!                                 "<table %s><caption align=\"top\">"
                                  "Retrieved %d rows * %d fields"
                                  "</caption>\n",
                             po->tableOpt ? po->tableOpt : "", nTups, nFields);
***************
*** 406,413 ****
              {
                  if (po->html3)
                      fprintf(fout,
!                             "<tr><td align=left><b>%s</b></td>"
!                             "<td align=%s>%s</td></tr>\n",
                              fieldNames[j],
                              fieldNotNum[j] ? "left" : "right",
                              pval);
--- 406,413 ----
              {
                  if (po->html3)
                      fprintf(fout,
!                             "<tr><td align=\"left\"><b>%s</b></td>"
!                             "<td align=\"%s\">%s</td></tr>\n",
                              fieldNames[j],
                              fieldNotNum[j] ? "left" : "right",
                              pval);
***************
*** 502,508 ****

          if (po->html3)
          {
!             fprintf(fout, "<th align=%s>%s</th>",
                      fieldNotNum[j] ? "left" : "right", fieldNames[j]);
          }
          else
--- 502,508 ----

          if (po->html3)
          {
!             fprintf(fout, "<th align=\"%s\">%s</th>",
                      fieldNotNum[j] ? "left" : "right", fieldNames[j]);
          }
          else
***************
*** 546,552 ****
          char       *p = fields[row_index * nFields + field_index];

          if (po->html3)
!             fprintf(fout, "<td align=%s>%s</td>",
                      fieldNotNum[field_index] ? "left" : "right", p ? p : "");
          else
          {
--- 546,552 ----
          char       *p = fields[row_index * nFields + field_index];

          if (po->html3)
!             fprintf(fout, "<td align=\"%s\">%s</td>",
                      fieldNotNum[field_index] ? "left" : "right", p ? p : "");
          else
          {

pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PQprint under Windows
Next
From: Bruce Momjian
Date:
Subject: Re: PQprint under Windows