Re: Text search language field
От | Daniel Staal |
---|---|
Тема | Re: Text search language field |
Дата | |
Msg-id | 4A6C96A2A2BAE32F48DF47C0@mac-pro.magehandbook.com обсуждение исходный текст |
Ответ на | Text search language field (Daniel Staal <DStaal@usa.net>) |
Список | pgsql-novice |
--As of May 12, 2012 8:08:42 PM -0400, PGSQL-Novice is alleged to have said: > Tables: > > Resource: > "text_element" text, > "text_search" tsvector, > "language" char varying(3) references "languages" > > languages (This is 'static' list of ISO 639-3 codes, to make sure > everything uses the same codes): > "code" character varying(3) primary key, > "description" character varying(100) > The trigger currently throws an error 'column "language" is not of > regconfig type' whenever I try to use it, and I'm looking for the best > way to solve that. The 'simple' solution of 'create text search > configuration eng ( copy = pg_catalog.english );' didn't work. Before I > start into a long exploration into why and what should be done about it, > I thought I'd seek wisdom. ;) --As for the rest, it is mine. Ok, after a bit of exploration, there are two problems with my current approach: The 'config_column_name' passed to 'tsvector_update_trigger_column' cannot be a text column. The config in the config column must be fully qualified. (So I can't use 'english', I'd have to use 'pg_catalog.english'.) Combined, these mean I it's probably not worth trying to use the column to tell both my app and Postgresql what language is being used. So, anyone have any ideas on how to write a trigger to pull the field from the language table based on the code? Daniel T. Staal --------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
В списке pgsql-novice по дате отправления: