Re: 8.3 version of ts_headline

From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: 8.3 version of ts_headline
Date: 2007-09-15 09:52:55
Message-ID: 200709151152.55213.andreak@officenet.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday 14 September 2007 20:26:28 Tom Lane wrote:
> Andreas Joseph Krogh <andreak(at)officenet(dot)no> writes:
> > In 8.2 this produces an error:
> >
> > SELECT headline('default', 'a b c', 'c'::tsquery,
> > 'StartSel=<span class="style1">, StopSel=</span>');
> > ERROR: syntax error
> > DETAIL: Syntax error in position 15.
>
> Sure you don't just need to quote the values?
>
> regression=# SELECT ts_headline('english', 'a b c', 'c'::tsquery,
> $$StartSel='<span class="style1">', StopSel='</span>'$$);
> ts_headline
> -----------------------------------
> a b <span class="style1">c</span>
> (1 row)
>
>
> regards, tom lane

Doesn't work in 8.2:

andreak=# SELECT headline('default', 'a b c', 'c'::tsquery,
$$StartSel='<span class="style1">', StopSel='</span>'$$);
ERROR: syntax error
DETAIL: Syntax error in position 16.
andreak=# select version();
version
------------------------------------------------------------------------------------------------
PostgreSQL 8.2.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2
(Ubuntu 4.1.2-0ubuntu4)
(1 row)

--
Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Senior Software Developer / Manager
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Karenslyst Allé 11 | know how to do a thing and to watch |
PO. Box 529 Skøyen | somebody else doing it wrong, without |
0214 Oslo | comment. |
NORWAY | |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2007-09-15 16:27:19 Re: PL/TCL Patch to prevent postgres from becoming multithreaded
Previous Message Tom Lane 2007-09-15 01:53:28 Re: PL/TCL Patch to prevent postgres from becoming multithreaded