psql HTML mode - quoting HTML characters - Mailing list pgsql-general

From Nicholson, Brad (Toronto, ON, CA)
Subject psql HTML mode - quoting HTML characters
Date
Msg-id EC55DC235432104F8255702A8D7344D9256BD52B@G9W0741.americas.hpqcorp.net
Whole thread Raw
Responses Re: psql HTML mode - quoting HTML characters  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-general
Hi,

How do I quote characters like < and > in psql's HTML mode?

For example:


Regular mode:
postgres=# select '<a href=http://www.postgresql.org>Postgres</a>';
                    ?column?
------------------------------------------------
 <a href=http://www.postgresql.org>Postgres</a>
(1 row)

HTML mode:
postgres=# \H
Output format is html.
postgres=# select '<a href=http://www.postgresql.org>Postgres</a>';
<table border="1">
  <tr>
    <th align="center">?column?</th>
  </tr>
  <tr valign="top">
    <td align="left"><a href=http://www.postgresql.org>Postgres</a></td>
  </tr>
</table>
<p>(1 row)<br />
</p>


I would like the line

<td align="left"><a href=http://www.postgresql.org>Postgres</a></td>

To be

<td align="left<a href=http://www.postgresql.org>Postgres</a></td>

Thanks,
Brad

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: All and ANY
Next
From: Alexander Farber
Date:
Subject: Re: Saving score of 3 players into a table