Re: tsearch2 problems / limitations

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: James Croft <noemail(at)address(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 problems / limitations
Date: 2005-02-23 08:42:23
Message-ID: 20050223084223.GB23608@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 22, 2005 at 01:29:45PM +0000, James Croft wrote:

> One of the tables holds reasonable amounts of text, some fields hold up
> to 2Mb. When I try and run
>
> UPDATE table SET idxfti=to_tsvector('default', field);
>
> it runs for a while then aborts with the following message
>
> ERROR: value is too big

README.tsearch2 says that the maximum size of a tsvector is 2^20
bytes (1M). You can see that limit enforced in the makevalue()
function in tsvector.c (similarly in pushquery() in query.c):

if (cur - str > MAXSTRPOS)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("value is too big")));

MAXSTRPOS is defined in tsvector.h:

#define MAXSTRPOS ( 1<<20 )

Maybe Oleg will reply and say whether it's safe to change that
or not.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andre Schnoor 2005-02-23 10:00:11 Re: Simple client messages from within pgPL/SQL
Previous Message Andreas Hartmann 2005-02-23 08:38:33 Re: Different execution time from psql and JDBC