pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Christoph Zwerschke <cito@online.de>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQprint under Windows
Date: Mon, 6 Feb 2006 20:23:27 -0500 (EST)
Message-ID: <200602070123.k171NRA27993@candle.pha.pa.us> (raw)
In-Reply-To: <43E7DB7F.7030101@online.de>

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
  		{

Attachments:

  [text/plain] /rtmp/diff (2.9K, ../200602070123.k171NRA27993@candle.pha.pa.us/2-%2Frtmp%2Fdiff)
  download | inline:
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
  		{

view thread (8+ messages)  latest in thread

Message-ID: <200602070123.k171NRA27993@candle.pha.pa.us>
Permalink:  ../200602070123.k171NRA27993@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200602070123.k171NRA27993@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, cito@online.de
  Subject: Re: PQprint under Windows
  In-Reply-To: <200602070123.k171NRA27993@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox