Re: trigger creation error (tsvector_update_trigger)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dhanunjaya naidu yandrapu <dhanu(dot)techhelp(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger creation error (tsvector_update_trigger)
Date: 2009-02-14 16:36:09
Message-ID: 2973.1234629369@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

dhanunjaya naidu yandrapu <dhanu(dot)techhelp(at)gmail(dot)com> writes:
> I am getting the following error while creating a trigger

> jistest=> CREATE TRIGGER resumes_tsv_update_title_tsvector BEFORE INSERT OR
> UPDATE ON resumes FOR EACH ROW EXECUTE PROCEDURE
> tsvector_update_trigger(title_tsvector, 'pg_catalog.english', title);
> ERROR: syntax error at or near "."
> LINE 1: ...svector_update_trigger(title_tsvector, 'pg_catalog.english',...

hmm, it works here. Are you sure you copied the command correctly?

regression=# create table resumes(title text, title_tsvector tsvector);
CREATE TABLE
regression=# CREATE TRIGGER resumes_tsv_update_title_tsvector BEFORE INSERT OR
regression-# UPDATE ON resumes FOR EACH ROW EXECUTE PROCEDURE
regression-# tsvector_update_trigger(title_tsvector, 'pg_catalog.english', title);
CREATE TRIGGER
regression=# insert into resumes values('the foo bar');
INSERT 0 1
regression=# select * from resumes;
title | title_tsvector
-------------+-----------------
the foo bar | 'bar':3 'foo':2
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-02-14 16:41:05 Re: currval() in insert statements
Previous Message Raymond O'Donnell 2009-02-14 16:35:56 Re: currval() in insert statements