Re: C function to create tsquery not working - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: C function to create tsquery not working
Date
Msg-id 20100225113039.53fa661e@dawn.webthatworks.it
Whole thread Raw
In response to C function to create tsquery not working  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: C function to create tsquery not working
List pgsql-general
On Thu, 11 Feb 2010 20:11:54 +0100
Ivan Sergio Borgonovo <mail@webthatworks.it> wrote:

> I'm still having trouble making this work:
>
> http://pgsql.privatepaste.com/14a6d3075e

I tried to play with
item->operator.left
to see if reshuffling the expression could make any difference.
item->operator.left = 2 * lexeme - 2 (1 + i)
or
item->operator.left = lexemes

But the result seems pretty indifferent to what I put in
operator.left.
That makes me think the error is here.

But I still get those 2 kind of error:
ERROR:  unrecognized operator type: 50 (first run)
or
ERROR:  stack depth limit exceeded

Just at the 3rd returned row, just for certain queries (see previous
email).

It doesn't look as if I palloced too few memory, I tried to allocate
3x the memory I estimated and I still get the errors.

The function is actually returning correct results, so it seems the
tsquery object is well formed.

But still it looks like infix() is trying to read more operators
than the one I thought I've put in... but just for certain queries,
and just at the 3rd row returned.

Should I use something different than palloc? Should I return the
query differently? Am I supposed to free something?


--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Global Temp Table
Next
From: Pavel Stehule
Date:
Subject: Re: C function to create tsquery not working