Search Postgresql Archives

Re: tsearch2 Trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx)


--
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

begin:vcard
fn:Joshua D. Drake
n:Drake;Joshua D.
org:Command Prompt, Inc.
adr:;;PO Box 215;Cascade Locks;Oregon;97014;USA
email;internet:jd@xxxxxxxxxxxxxxxxx
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We  provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored  the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux