Skip site navigation (1) Skip section navigation (2)

Re: Tsearch 2, index in different table?

From: Mag Gam <magawake(at)gmail(dot)com>
To: Charley Tiggs <ctiggs(at)xpressdocs(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Tsearch 2, index in different table?
Date: 2005-12-22 16:49:54
Message-ID: 1cbd6f830512220849t5768dc83i85072844cdb1cc9@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Charley:

thanks for the reply, I have already tried this.

I have something like this:


CREATE TABLE tsearch_index ( i serial PRIMARY key);
CREATE TABLE book (book_id serial PRIMARY KEY, title varchar(100));
ALTER TABLE tsearch_index ADD COLUMN idxFTI tsvector;
INSERT INTO book (title) VALUES ('Duck Tales');
INSERT INTO book (title) VALUES ('Jungle Book');

When I run your query:

test=# UPDATE tsearch_index SET idxFTI=to_tsvector('default',coalesce(SELECT
test(# title FROM book,''));
ERROR:  syntax error at or near "SELECT" at character 64
LINE 1: ...earch_index SET idxFTI=to_tsvector('default',coalesce(SELECT

Any other suggestions?


On 12/22/05, Charley Tiggs <ctiggs(at)xpressdocs(dot)com> wrote:
>
> On Dec 22, 2005, at 9:28 AM, Mag Gam wrote:
>
> > Trying this post again, since I can't post on pgsql-general....
> >
> > Is it possible to store an index in a different table? Instead of
> > keeping the index in a separate column, I have a separate table for
> > storing all indexes. I am trying to set up something like this:
> >
> > UPDATE indexTable SET index1=to_tsvector('default',coalesce
> > (Table1.Data,''));
> >
> > This is currently not working, but something in this line. Is this
> > possible? Does tsearch2 only restrict to 1 table?
>
> I believe you have to select the data from Table1.
>
> UPDATE indexTable SET index1=to_tsvector('default',coalesce(SELECT
> data FROM table1,''));
>
> Charley
>

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2005-12-22 17:25:55
Subject: Re: long transaction with concurrent SELECT statements
Previous:From: Mag GamDate: 2005-12-22 15:28:06
Subject: Tsearch 2, index in different table?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group