Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxpwj-0002Tz-KF for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Jan 2021 11:28:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxpwi-0000xX-Gs for pgsql-bugs@arkaria.postgresql.org; Fri, 08 Jan 2021 11:28:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxpXc-0000t8-6k for pgsql-bugs@lists.postgresql.org; Fri, 08 Jan 2021 11:02:48 +0000 Received: from webmail.i2rs.nl ([159.65.192.235]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxpXU-0003tC-Pa for pgsql-bugs@lists.postgresql.org; Fri, 08 Jan 2021 11:02:47 +0000 Received: from [192.168.178.8] (unknown [83.162.200.97]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by webmail.i2rs.nl (Postfix) with ESMTPSA id B3FE9FC645 for ; Fri, 8 Jan 2021 12:02:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=i2rs.nl; s=mail; t=1610103758; bh=0vOqusiLgStf01ArOgqoQ19UPkDySK7UeRX8cmK1/8g=; h=Subject:To:References:From:Date:In-Reply-To:From; b=RudfXyTAB2BsyRrDZwWwdLSM/vI1ixENX0vOwOGk2FekSMIAIacKgB7myoGpM0kYo yWzuC3MTdNvsVr4dxSreAwi9+XpfhO+OF8IeW89PcZf94fd+8CNs+PIfaVmhDxb8yZ 7S9vA8PEj9gbjKmezVo3SnYUhZmHugrmO7SjxnRaDmzdZShmqCbpbg9dgyOuwyzNxB EVRQKqUdD+aWIoQkaQGLbTkb7h/Mi18IwC8p05nD/AL7HvZqYq5B1A8utxwPkwrJXK tKVarhTUNBw342WxQJ8GTJuaVYt5LHfzAnZD2lVGuXpDKMN4aZSW5IRmny1uKmqRmS U9LyqshnNZMAA== Subject: Re: BUG #16816: Unexpected escaping of html output To: pgsql-bugs@lists.postgresql.org References: <16816-4c7637cc57fba45f@postgresql.org> From: Jeroen Baten X-Pep-Version: 2.0 Message-ID: <897ab93f-8667-85b6-ff45-e1864babc0f7@i2rs.nl> Date: Fri, 8 Jan 2021 12:02:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <16816-4c7637cc57fba45f@postgresql.org> Content-Type: multipart/mixed; boundary="------------6722CCAC348D2E570B9E811D" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------6722CCAC348D2E570B9E811D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Fixed it. select '', format('%s',t.id,t.number) as TicketID, '' from tickets as t, users as u psql -h ${host} -U zammad zammad=C2=A0 --tuples-only -AF ' '=C2=A0 -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: =20 > > 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 transfo= rm to > pdf using wkhtmltopdf. > psql --html escapes html that I purposely enter into the select stateme= nt. > (As I user I would like to be able to generate html in my select statem= ents, > even when using the html format output format) > > Example: > Running psql --html > > select format(' href=3D"https://zammad.thuis.local#ticket/zoom/%s">%s',t.number,t.n= umber) > as TicketID from tickets as t, users as u where t.owner_id=3Du.id and > date(t.close_at) is null and t.owner_id=3Du.id order by t.close_at limi= t 1 ; > > > > > > > > > >
ticketid
<a > href=3D"https://zammad.thuis.local#ticket/zoom/85117">8511= 7</a>
>

(1 row)
>

> > Running psql without --html > > ticketid =20 > ------------------------------------------------------------------ > 85117 > > Any and all help is highly appriciated. > Kind regards, > Jeroen Baten > > --=20 Jeroen Baten | EMAIL : JBATEN@I2RS.NL ____ _ __ | web : www.i2rs.nl | )|_)(_ | tel : +31 (0)648519096 _|_/_| \__) | Frisolaan 16, 4101 JK, Culemborg, the Netherl= ands --------------6722CCAC348D2E570B9E811D Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGiBDwZtqoRBACSFpl44rZ2x7QvRXS4jJkW1cH9YXcdYvhbgLt5oJsuFuICLOqn e5a5/zxkBsmkZ1IJXyjKOk7/oQJ/sEqVZWi0LkwbYLmCU/SPiiAfInDbY0mtblVV N2EPX3ZO6DmBbV05PfqKSrz4VYk51ONME6ePuGvNnMfeUGln21i67MLtewCghqNj xeFT15MLLkmjXjqcD3tybPkEAIvXmwJhdo57QAnBSBRHhxKuJKqk2jeipDv9HiEZ 3PywS4wUaZtmfKcbQsHsQYgM80a2BArHABaO8bbXT3CsNpiPlkCdUXZmJ+XFvhr5 9elPQ2N7XxP5HojDwhsS8frTj2JfOVhuKnXxpMilhfp4Or6+QsBCrk8CkbiOluRc O8gEA/9DEM0ApggsWnN7VwMis21BwrMrKDD6M0d7+by9hEYLlOOsqraSuBVfhhac hTenZQEGcfa4adbiQJa4D4nCIRtE1A7AX2mKjLkLVE+z+mkOLNLC/SuzRSD8v00M 70+ZIgm6QAo8lfoTMM5dZ4QhZjmlZxTOg+vSPtK807oGge8nCbQlSmVyb2VuIEJh dGVuIChrd29vdCkgPGpiYXRlbkBpMnJzLm5s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