Re: exposing more parse was: Re: tsearch2: setting weights on tsquery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: exposing more parse was: Re: tsearch2: setting weights on tsquery
Date: 2008-10-21 17:40:33
Message-ID: 27925.1224610833@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> writes:
> I missed it. Thanks. Nearly perfect. Now I've to understand what a
> {} is.
> An array with a null element? an empty array? an array containing ''?

Hmm ... it appears that ts_lexize is returning a one-dimensional array of
no elements, whereas '{}'::text[] returns a zero-dimensional array;
as does array[]::text[] so you can't easily get around it :-(

We probably ought to clean this up...

In the meantime it looks like you could check for
"array_upper(lexemes,1) > 0".

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glen Brown 2008-10-21 17:54:50 Slow to delete TOAST table data
Previous Message Tom Lane 2008-10-21 17:01:17 Re: Varchar vs varchar(64)