On Wed, Mar 05, 2008 at 10:53:38AM -0500, Bruce Momjian wrote:
> Euler Taveira de Oliveira wrote:
> > Edwin Groothuis wrote:
> > > Ouch. But... since very long words are already not indexed (is the length
> > > configurable anywhere because I don't mind setting it to 50 characters), I
> > > don't think that it should bomb out of this but print a similar warning like
> > > "String only partly indexed".
> > >
> > This is not a bug. I would say it's a limitation. Look at
> > src/include/tsearch/ts_type.h. You could decrease len in WordEntry to 9
> > (512 characters) and increase pos to 22 (4 Mb). Don't forget to update
> > MAXSTRLEN and MAXSTRPOS accordingly.
> > > I'm still trying to determine how big the message it failed on was...
> > >
> > Maybe we should change the "string is too long for tsvector" to "string
> > is too long (%ld bytes, max %ld bytes) for tsvector".
> Good idea. I have applied the following patch to report in the error
> message the string length and maximum, like we already do for long
> test=> select repeat('a', 3000)::tsvector;
> ERROR: word is too long (3000 bytes, max 2046 bytes)
> test=> select repeat('a ', 3000000)::tsvector;
> ERROR: string is too long for tsvector (1048576 bytes, max 1048575 bytes)
Is it possible to make it a WARNING instead of an ERROR? Right now I get:
NOTICE: word is too long to be indexed
DETAIL: Words longer than 2047 characters are ignored.
when updating the dictionary on a table, which will make it continue,
but with some long messages I get:
ERROR: string is too long for tsvector
Which is quite fatal for the whole UPDATE / INSERT statement.
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin(at)mavetju(dot)org | Weblog: http://www.mavetju.org/weblog/
In response to
pgsql-bugs by date
|Next:||From: Ted Kremenek||Date: 2008-03-05 22:12:47|
|Subject: BUG #4015: uninitialized value passed as an argument to tm2timetz|
|Previous:||From: Bill Moran||Date: 2008-03-05 18:58:25|
|Subject: Re: BUG #4012: bug in pg_query|
pgsql-patches by date
|Next:||From: Bryce Nesbitt||Date: 2008-03-05 21:06:12|
|Subject: Proposed patch - psql wraps at window width|
|Previous:||From: Tom Lane||Date: 2008-03-05 20:33:57|
|Subject: Re: NetBSD/MIPS supports dlopen |