Re: PLPerl Trigger to update text search - Mailing list pgsql-general

From Alex Hunsaker
Subject Re: PLPerl Trigger to update text search
Date
Msg-id CAFaPBrS+gvQtNE=3mktrpyMXFsFoQPmL3a=HPWhdLeje+p2JuQ@mail.gmail.com
Whole thread Raw
In response to Re: PLPerl Trigger to update text search  (Alex Hunsaker <badalex@gmail.com>)
List pgsql-general


On Fri, Jul 31, 2015 at 7:15 PM, Alex Hunsaker <badalex@gmail.com> wrote:



$_TD->{new}{text_search} = spi_exec_query("to_tsvector('pg_catalog.english', ". quote_literal('text1 text2') .";")->{rows}[0]{to_tsvector};


Err that should be:
(still untested, was missing the "select" bit)

$_TD->{new}{text_search} = spi_exec_query("select to_tsvector('pg_catalog.english', ". quote_literal('text1 text2') .";")->{rows}[0]{to_tsvector};

pgsql-general by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: PLPerl Trigger to update text search
Next
From: Ramesh T
Date:
Subject: postgres 9.3