On Sat, 08 Nov 2008 09:44:17 +0100 Andreas Kraftl <andreas.kraftl@xxxxxxxxx> wrote: > Hello again, > my previous post wasn't answered. I think i told my question > wrong :-). > > I have a table like > a | b > -------------------- > 'de' | Hallo welt > 'en' | Hello world > > How can I create a full text index over b? > CREATE INDEX idx ON table USING gin( > to_tsvector( > case > when a = 'de' then 'german' > when a = 'en' then 'english' > else 'english' > end > ), b); > > This doesn't work. Error Message in german: > FEHLER: Zugriffsmethode »gin« unterstützt keine mehrspaltigen > Indexe SQL state: 0A000 > means, gin doesn't accept multicolumn indexes. > > Any ideas? Multicolumn indexes should get into 8.4. You may add a column tsvector and compute it with a trigger that chose the correct language when generating the tsvector. Then you'll have to pick up the correct language when you generate the tsquery in your search. http://www.sigaev.ru/gin/fastinsert_and_multicolumn_GIN.pdf -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general