partial index on a text field - Mailing list pgsql-general

From Chris
Subject partial index on a text field
Date
Msg-id 001901c4ba40$d064b270$0d00a8c0@chris
Whole thread Raw
Responses Re: partial index on a text field
List pgsql-general
Hi all,

I have a text field which I'll be doing LIKE searches against so I
wanted to set up an index on it.

The data itself is too long to create a full index, so I can't just:

chris=> create index blah on ff_index(icontent);
ERROR:  index row requires 21216 bytes, maximum size is 8191

So I thought I'd set up an index to use the first say 200 chars of the
string

chris=> create index blah on ff_index(substring(icontent, 0, 200));
ERROR:  syntax error at or near "(" at character 40

I've tried many variations of this, same result.

I know I can create a partial index on it if the field is less than 200
chars, but that doesn't help me.

I'm running v7.4.5.

Any suggestions ?

Thanks,
Chris.


pgsql-general by date:

Previous
From: Ken Tozier
Date:
Subject: Re: Importing a tab delimited text file - How?
Next
From: Tom Lane
Date:
Subject: Re: partial index on a text field