Re: [GENERAL] tsearch2() with data from other table

2006-11-10 Thread Teodor Sigaev
CREATE FUNCTION euits(int) RETURNS text AS 'select username || \' \' || firstname || \' \' || lastname from site_user where objectid = $1;' LANGUAGE SQL; CREATE TRIGGER site_item_fts BEFORE UPDATE OR INSERT ON site_item FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxfti, name, keywords, keywords_cb

Re: [GENERAL] tsearch2() with data from other table

2006-11-10 Thread Marcus Engene
Teodor Sigaev skrev: CREATE FUNCTION euits(int) RETURNS text AS 'select username || \' \' || firstname || \' \' || lastname from site_user where objectid = $1;' LANGUAGE SQL; CREATE TRIGGER site_item_fts BEFORE UPDATE OR INSERT ON site_item FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxfti, name,

Re: [GENERAL] tsearch2() with data from other table

2006-11-10 Thread Teodor Sigaev
CREATE FUNCTION euits(int) RETURNS text AS 'select username || \' \' || firstname || \' \' || lastname from site_user where objectid = $1;' LANGUAGE SQL; CREATE TRIGGER site_item_fts BEFORE UPDATE OR INSERT ON site_item FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxfti, name, keywords, keywords_cb

[GENERAL] tsearch2() with data from other table

2006-11-10 Thread Marcus Engene
Hi, I have a table with items. One field is site_user, which fk:s the user row that owns the item. There are a few fields i throw to tsearch2() via an index right now, but one user wanted his name to be in the search as well. So, what I would want to do is: CREATE FUNCTION euits(int) RETURNS te