I am writing a tsearch2 trigger function in plperl. I would like to run a query similar to this: setweight(to_tsvector(col1),'b') || setweight(to_tsvector(col2),'a') and insert the result into the tsvector column. I know I can call spi_exec_query('select ...') and insert the result, but is this the best way of doing it? I need the trigger to be plperl since there is some additional foo I am doing. Thanks! --Joel ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend