473,660 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tsearch index not set by UPDATE in PgSQL 7.3.2

The short question is why does this:

select to_tsvector('de fault', coalesce(name, '') ||' '||
coalesce(descri ption, '') ||' '|| coalesce(keywor ds,'')) from
link_items;

give different results than this:

update link_items set linksfti=to_tsv ector('default' , coalesce(name,
'')
||' '|| coalesce(descri ption, '') ||' '|| coalesce(keywor ds,''));
select linksfti from link_items;
Here are more details:

I am working with Tsearch2 on a server with version string:
PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC 2.96

I have a table with the following schema:
CREATE TABLE link_items
(
link_id int4,
name varchar(255),
url varchar(255),
description text,
spanish int4,
spanishurl varchar(255),
lastmod date,
visible int4,
state varchar(25),
promisepractice int4,
keywords text,
linksfti tsvector
)
WITH OIDS;
ALTER TABLE link_items OWNER TO gate;

I want linksfti to hold the search engine's indexing data (indexed on
'name', 'description', and 'keywords'), so I run the following command:

update link_items set linksfti=to_tsv ector('default' , coalesce(name,
'')
||' '|| coalesce(descri ption, '') ||' '|| coalesce(keywor ds,''));

The results are pretty empty. Most have empty strings for data, other
only index one or two items in the 3 input columns.

For example, after running, my table looks like:
<name>;<descrip tion>;<keywords >;<linksfti>
"American Occupational Therapy Association (AOTA) ";"National ly
recognized
professional association for over 60,000 occupational therapists and
occupational therapy assistants. ";"Rehabilitati on Professional
Associations and Councils";"'60' :1 '000':2"
"American Physical Therapy Association (APTA)";"Repres ents more than
70,000 physical therapists, physical therapist assistants, and students
of
physical therapy. ";"Rehabilitati on Professional Associations and
Councils";"'70' :1 '000':2"
"U.S. Deaf Ski & Snowboard Association";"W inter sports for people who
are
deaf & relevant links.";"Recrea tion Winter Sports";"'u.s': 1"
"Texas Adaptive Aquatics";"Adap tive water skiing program for people
with
physical and/or mental disabilities. ";"Recreati on Water
Sports";"'and/or':1"
"World T.E.A.M. Sports";"Inclus ive sports activities.";"R ecreation Team
Sports";"'t.e.a .m':1"
"Tennessee";"Of ficial State Web Site";"Legal State Agencies";""
"Project Vote Smart";"By entering zip code, users get list of all their
elected officials. Links to elected officials' and candidates' web
sites,
etc. ";"Governme nt / Public Policy General";""
"TRIPOD Captioned Films";"Caption ed Films for people who are deaf or
hard
of hearing.";"Recr eation Captioned Movies";""
When don't do it as an UPDATE and just print the contents to the
screen, I
get the full expected output:

select name, description, keywords, to_tsvector('de fault',
coalesce(name,
'') ||' '|| coalesce(descri ption, '') ||' '|| coalesce(keywor ds,''))
from
link_items;

"United States of America Deaf Track and Field";"Promote s training of
track athletes who are deaf and coaches who are deaf and hearing.
";"Recreati on Track";"'of':3, 11 'and':7,17,22 'are':15,20 'who':14,19
'deaf':5,16,21 'hear':23 'unit':1 'coach':18 'field':8 'state':2
'track':6,12,25 'train':10 'athlet':13 'promot':9 'america':4
'recreat':24"
"Adventure Pursuit, Inc.";"Adventur e Pursuit is a group of volunteers
who
like spending time with all kinds of people and focus on adventure
sports
like kayaking.";"Rec reation Water Sports";"'a':7 'is':6 'of':9,18
'on':22
'all':16 'and':20 'inc':3 'who':11 'kind':17 'like':12,25 'time':14
'with':15 'focus':21 'group':8 'kayak':26 'peopl':19 'spend':13
'sport':24,29 'water':28 'volunt':10 'pursuit':2,5 'recreat':27
'adventur':1,4, 23"
Using pgAdminIII, I copied (default backup/restore) the database from
our
production server and put in on my personal desktop (Windows 2000,
PgSQL
8.0.0) and re-ran the update query and it gave proper results.

Is it a known issue with 7.3.2, and is there a workaround without
upgrading the server to 8.0.0? We will upgrade in a few months, but we
can't take the server offline now because we have too many websites
that
depend on it.

Nov 23 '05 #1
0 2641

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
17004
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
0
1373
by: Joerg Erdmenger | last post by:
Hi there, I have an issue with tsearch. I'm using tsearch as a search mechanism on a website making various queries created from the words that a user has put in. So I query for all the words put in combined with a logical 'and' and also a query with all the words combined with a logical 'or'. In the 'and' case stopwords are correctly ignored whereas in the 'or' case they are not apparently, e.g. select 'tax&and&work'::mquery_txt;
3
4136
by: Joerg Erdmenger | last post by:
Hi there, me again. How do I find the stopwords that tsearch uses in its standard configuration? I've looked at contrib/tsearch/dict/porter_english.dct and get a feeling it's somewhere in there but I can't decipher it. Any suggestions? Joerg ---------------------------(end of broadcast)---------------------------
13
2862
by: Nigel J. Andrews | last post by:
This will be a little vague, it was last night and I can't now do the test in that db (see below) so can't give the exact wording. I seem to remember a report a little while ago about tsearch v2 causing unexpected backend exit messages with 7.3.4 and now I'm getting similar messages unpredictably and I can't find the thread in the archives either. What I did was install tsearch2 using share/contrib/tsearch2.sql, which placed everything...
6
1568
by: Ian Ribas | last post by:
Hello, This is probably a common problem, but I couldn't really find a direct answer in the archives (or maybe just couldn't find one that satisfied me ;-). I created an index specifically to help a query and the optimizer does not use it. It prefers an older index that has one less column, but that yields much poorer performance. The query get the smallest date in a period, for some criteria. The one table used in the query has...
2
1426
by: Rajesh Kumar Mallah | last post by:
Hi, I think when search terms have "."s in them they become case sensitive in tsearch searches. How can we make them insensitive? Regds Mallah.
24
2938
by: Henrik Steffen | last post by:
hello all, on my master-db-server i'm running postgres 7.4.1, and I have got two slave-servers running postgres 7.4.2 running the following query on the master-server (7.4.1) delivers: explain analyze select * from foo where bar like '0101%' and foobar like 'top%';
7
1706
by: Heiko Pohl | last post by:
Hello, upgrading my OS from RedHat 8.0 to FC2, postgresql was also automatically updated from 7.2. to 7.4. Unfortunately, I did not "dumpall"... How can I get my data??? I copied the data-folder to another location and so got running the new postgresql-server. I tried to install the old 7.2.4.tar.gz in a new folder, but it don't go further than ./configure. gmake gives the following lines at the end: (second time tiping gmake) gcc -O2...
3
1295
by: Marcel Boscher | last post by:
For now i am almost statisfied with my tsearch2 installation war over night somehow it seems to work, finally... 3 probably easy questions remain... 1.) Is it possible to index already filled tables? 2.)Can i have seperated indexes for different columns in a table 3.) Can i create an extra Table just for my indexes that is not included in my data table? Greetings
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.