diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-06-12 07:52:51 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-06-12 07:52:51 +0000 |
commit | ef2ba427171d59ad9af78af48c52fa24b2131589 (patch) | |
tree | 7e2b84df9825a7ce2afd1c7a50df000c2443875c /src/bin/psql/common.c | |
parent | e9cda08b2b79303e36594e1d4e5e09ea2db84b6a (diff) | |
download | postgresql-ef2ba427171d59ad9af78af48c52fa24b2131589.tar.gz postgresql-ef2ba427171d59ad9af78af48c52fa24b2131589.zip |
Attached is a patch that enhances the output of psql's HTML mode.
The output now validates as HTML 4.01 Strict, XHTML 1.0 strict,
and XHTML 1.1 (assuming you wrap it in a valid html/body document).
It also wraps the output of PGRES_COMMAND_OK if the HTML tag is on,
for full compliance: this is why html_escaped_print has to be
externalized.
Greg Sabino Mullane greg@turnstep.com
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r-- | src/bin/psql/common.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index ba6e2954481..3769f671d16 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.62 2003/03/25 02:44:36 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.63 2003/06/12 07:52:51 momjian Exp $ */ #include "postgres_fe.h" #include "common.h" @@ -525,7 +525,18 @@ PrintQueryResults(PGresult *results, success = true; sprintf(buf, "%u", (unsigned int) PQoidValue(results)); if (!QUIET()) - fprintf(pset.queryFout, "%s\n", PQcmdStatus(results)); + { + if (pset.popt.topt.format == PRINT_HTML) + { + fputs("<p>", pset.queryFout); + html_escaped_print(PQcmdStatus(results), pset.queryFout); + fputs("</p>\n", pset.queryFout); + } + else + { + fprintf(pset.queryFout, "%s\n", PQcmdStatus(results)); + } + } SetVariable(pset.vars, "LASTOID", buf); break; } |