BUG #16816: Unexpected escaping of html output

Поиск
Список
Период
Сортировка
Искать

BUG #16816: Unexpected escaping of html output

От:
PG Bug reporting form <noreply@postgresql.org>
Дата:
The following bug has been logged on the website:

Bug reference:      16816
Logged by:          Jeroen Baten
Email address:      jbaten@i2rs.nl
PostgreSQL version: 12.5
Operating system:   Ubuntu Linux 20.04
Description:        

Hi,

I am not sure if this is a bug, but I can't see to find any place
(web/books/google/irc) that has a solution to my problem.
So, in the end, I turn to the development team.

My problem is: I use psql --html to generate output that I then transform to
pdf using wkhtmltopdf.
psql --html escapes html that I purposely enter into the select statement.
(As I user I would like to be able to generate html in my select statements,
even when using the html format output format)

Example:
Running psql --html

select format('%s',t.number,t.number)
as TicketID from tickets as t, users as u where t.owner_id=u.id and
date(t.close_at) is null and t.owner_id=u.id order by t.close_at limit 1 ;


ticketid
<a href="https://zammad.thuis.local#ticket/zoom/85117">85117</a>

(1 row)

Running psql without --html ticketid ------------------------------------------------------------------ 85117 Any and all help is highly appriciated. Kind regards, Jeroen Baten

Re: BUG #16816: Unexpected escaping of html output

От:
Jeroen Baten <jbaten@i2rs.nl>
Дата:
Вложения:
Fixed it.

select
'',
format('%s',t.id,t.number) as
TicketID,
''
from tickets as t, users as u

psql -h ${host} -U zammad zammad  --tuples-only -AF ' '  -c "${query}"

Works!

Op 08-01-2021 om 11:29 schreef PG Bug reporting form:
> The following bug has been logged on the website:
>
> Bug reference:      16816
> Logged by:          Jeroen Baten
> Email address:      jbaten@i2rs.nl
> PostgreSQL version: 12.5
> Operating system:   Ubuntu Linux 20.04
> Description:        
>
> Hi,
>
> I am not sure if this is a bug, but I can't see to find any place
> (web/books/google/irc) that has a solution to my problem.
> So, in the end, I turn to the development team.
>
> My problem is: I use psql --html to generate output that I then transform to
> pdf using wkhtmltopdf.
> psql --html escapes html that I purposely enter into the select statement.
> (As I user I would like to be able to generate html in my select statements,
> even when using the html format output format)
>
> Example:
> Running psql --html
>
> select format(' href="https://zammad.thuis.local#ticket/zoom/%s">%s',t.number,t.number)
> as TicketID from tickets as t, users as u where t.owner_id=u.id and
> date(t.close_at) is null and t.owner_id=u.id order by t.close_at limit 1 ;
>
>
> 
>   
>     
>   
>   
>     
>   
> 
ticketid
<a > href="https://zammad.thuis.local#ticket/zoom/85117">85117</a>
>

(1 row)
>

> > Running psql without --html > > ticketid > ------------------------------------------------------------------ > 85117 > > Any and all help is highly appriciated. > Kind regards, > Jeroen Baten > > -- Jeroen Baten | EMAIL : JBATEN@I2RS.NL ____ _ __ | web : www.i2rs.nl | )|_)(_ | tel : +31 (0)648519096 _|_/_| \__) | Frisolaan 16, 4101 JK, Culemborg, the Netherlands
FAQ