pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #8662: psql -H and ts_headline
3+ messages / 2 participants
[nested] [flat]
* BUG #8662: psql -H and ts_headline
@ 2013-12-07 00:03 cbfgterfdy@zacglen.net
2013-12-20 15:35 ` Re: BUG #8662: psql -H and ts_headline Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 3+ messages in thread
From: cbfgterfdy@zacglen.net @ 2013-12-07 00:03 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 8662
Logged by: JW
Email address: cbfgterfdy@zacglen.net
PostgreSQL version: 9.2.4
Operating system: Linux
Description:
While "psql -H" is quite useful there is flaw when a query includes
ts_headline(). The highlighting html gets escaped along with any other html
special characters.
One can pipe the psql output through sed and undo the special character
conversion. But it would perhaps be nicer if there was some way of allowing
embedded html in results if so wanted.
The html output doesn't have any escaping mechanism what-so-ever.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #8662: psql -H and ts_headline
2013-12-07 00:03 BUG #8662: psql -H and ts_headline cbfgterfdy@zacglen.net
@ 2013-12-20 15:35 ` Peter Eisentraut <peter_e@gmx.net>
2013-12-20 21:12 ` Re: BUG #8662: psql -H and ts_headline cbfgterfdy@zacglen.net
0 siblings, 1 reply; 3+ messages in thread
From: Peter Eisentraut @ 2013-12-20 15:35 UTC (permalink / raw)
To: cbfgterfdy@zacglen.net; pgsql-bugs
On 12/6/13, 7:03 PM, cbfgterfdy@zacglen.net wrote:
> While "psql -H" is quite useful there is flaw when a query includes
> ts_headline(). The highlighting html gets escaped along with any other html
> special characters.
How would you address that? There is no way for psql or any other
client to know that the text data that is being returned is actually
HTML. A proper fix would be having an HTML data type, or having
ts_headline() return type XML.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #8662: psql -H and ts_headline
2013-12-07 00:03 BUG #8662: psql -H and ts_headline cbfgterfdy@zacglen.net
2013-12-20 15:35 ` Re: BUG #8662: psql -H and ts_headline Peter Eisentraut <peter_e@gmx.net>
@ 2013-12-20 21:12 ` cbfgterfdy@zacglen.net
0 siblings, 0 replies; 3+ messages in thread
From: cbfgterfdy@zacglen.net @ 2013-12-20 21:12 UTC (permalink / raw)
To: pgsql-bugs
>> While "psql -H" is quite useful there is flaw when a query includes
>> ts_headline(). The highlighting html gets escaped along with any other html
>> special characters.
>
>How would you address that? There is no way for psql or any other
>client to know that the text data that is being returned is actually
>HTML. A proper fix would be having an HTML data type, or having
>ts_headline() return type XML.
>
Perhaps it would be better if ts_headline() returned rows or an array
giving the highlight offsets and lengths rather than attempting to
mark-up the text. However one might also have a extra function
that took the offset information and annotated the text as in
"highlight(text, ts_headline(text))"
So the fault is not with psql, it is the faulty design of ts_headline().
I have also tried using the StartSel etc options and very bad result if
StartSel value involves a space or comma. Very strange design bundling
options into a single function argument. Having to put options into
a single-quote delimited string, yet not allowing for spaces
or commas to be escaped is not very flexible.
Perhaps the options could have been passed as a HSTORE type?
Would have made a lot more sense.
In any case a myriad of options seems to indicate that what should have
been multiple functions have all been bundled into one function.
And why couldn't the option arguments have been real separate arguments?
Is there some arcane limit on the number of function arguments?
Or was line wrap broken in authors text editor?
Also, would be nice of psql could have some html escape
mechanism so that something simple like "select '<b>'||column||'</b>'"
could be made to work. Unfortunately not so simple as a single
character escape mechanism, so perhaps a special function such
as unescaped('<b>').
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2013-12-20 21:12 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-07 00:03 BUG #8662: psql -H and ts_headline cbfgterfdy@zacglen.net
2013-12-20 15:35 ` Peter Eisentraut <peter_e@gmx.net>
2013-12-20 21:12 ` cbfgterfdy@zacglen.net
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