problem with coalesce

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: problem with coalesce
Date: 2005-08-18 18:58:33
Message-ID: Pine.GSO.4.63.0508182254420.17863@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi there,

I don't understand why this select doesn't works:

regression=# select coalesce(
tp_rewrite_substitute(ARRAY[query, test.target, test.sample]),
query)
from test,to_tsquery('new2 & york2 & hotel') as query
where query @ test.target;

ERROR: column "query.query" must appear in the GROUP BY clause or be used in an aggregate function

as a workaround I could explicitly specify query, but this doesn't looks
nice

regression=# select coalesce(
tp_rewrite_substitute(ARRAY[query, test.target, test.sample]),
to_tsquery('new2 & york2 & hotel'))
from test,to_tsquery('new2 & york2 & hotel') as query
where query @ test.target;

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-08-18 19:44:43 Re: problem with coalesce
Previous Message Josh Berkus 2005-08-18 18:48:08 Need help on SpikeSource Testing Contest