Re: Tsearch2 - Error using tsquery object in GROUP BBY

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Henrik Zagerholm <henke(at)mac(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tsearch2 - Error using tsquery object in GROUP BBY
Date: 2006-12-01 08:56:23
Message-ID: 456FEE37.8060500@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> The query I'm executing has a GROUP BY clause and because I'm using the
> headline function I need my tsquery object in the SELECT clause and
> therefor also in the GROUP BY clause.
> BUT when executing the query I get the following error. -> "could not
> identify an ordering operator for type tsquery"

Which version do you use? Only 8.2 will have comparison operator for tsquery.

>
> How do I solve this?
Use subselect:
SELECT *, headline(..., to_tsquery()) FROM
{
SELECT .... GROUP BY ...
);

BTW, for performance reason, it might be useful to use limit in inner select -
headline function is slow enough.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Peter 2006-12-01 09:01:54 named cache
Previous Message Isak Hansen 2006-12-01 08:52:12 Re: Separation of clients' data within a database