Re: tsearch2 Trigger - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: tsearch2 Trigger
Date
Msg-id 4207A6AE.7010501@commandprompt.com
Whole thread Raw
In response to tsearch2 Trigger  (Howard Cole <howard.cole@selestial.com>)
List pgsql-general
Howard Cole wrote:
> Hi,
>
> I have succussfully managed to install tsearch2 and can use it happily
> with selects, ts_vectors etc. My only problem is when using a trigger in
> the form suggested in the intro documentation.
>
> The trigger calls a function "tsearch2" which takes the tsvector column
> name, and the names of columns that the full text search is composed of.
>
> Unfortunately, In my web application, I need to call "select
> set_curcfg('default')" before every insert/update operation or I get an
> error about the locale.
>
> This is not a problem with searching, because I can force the locale by
> entering the configuration in the select command (e.g.
> to_tsquery('default', search)).
>
> Can I force the command in the tsearch2 function, or can I permanently
> set the config?

You should only have to call set_curcfg('default') at the beginning of
the script execution. So just make sure you call set_curcfg as the first
query in the connection, and make sure you are reusing the same
connection for your other operations during the life of the script run.

Sincerely,

Joshua D. Drake
Command Prompt, Inc.
503-667-4564

>
> Thanks.
>
> Howard Cole
> www.selestial.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


--
Command Prompt, Inc., your source for PostgreSQL replication,
professional support, programming, managed services, shared
and dedicated hosting. Home of the Open Source Projects plPHP,
plPerlNG, pgManage,  and pgPHPtoolkit.
Contact us now at: +1-503-667-4564 - http://www.commandprompt.com


Attachment

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Out of memory error
Next
From: "Karl O. Pinc"
Date:
Subject: Permissions on implicit SERIAL datatype seqeuences