[SQL] Comparing tsearch2 vectors.
Hi, We want to compare strings after stemming. Can anyone tell me what is the best method. I was thinking to compare the tsvector ,but there is no operator for that. Regds Mallah. tradein_clients=# SELECT to_tsvector('handicraft exporters'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 710.315 ms tradein_clients=# tradein_clients=# SELECT to_tsvector('handicrafts exporter'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 400.679 ms tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); ERROR: operator does not exist: tsvector = tsvector HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. tradein_clients=# -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---+ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] Comparing tsearch2 vectors.
O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > > Hi, > > We want to compare strings after stemming. Can anyone > tell me what is the best method. I was thinking to compare > the tsvector ,but there is no operator for that. I'd tokenize each string and then apply lexize() to get the equivalent stemified word, but what exactly are you trying to accomplish? > > Regds > Mallah. > > > > tradein_clients=# SELECT to_tsvector('handicraft exporters'); > +---+ > |to_tsvector| > +---+ > | 'export':2 'handicraft':1 | > +---+ > (1 row) > > Time: 710.315 ms > tradein_clients=# > tradein_clients=# SELECT to_tsvector('handicrafts exporter'); > +---+ > |to_tsvector| > +---+ > | 'export':2 'handicraft':1 | > +---+ > (1 row) > > Time: 400.679 ms > tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); > ERROR: operator does not exist: tsvector = tsvector > HINT: No operator matches the given name and argument type(s). You may > need to add explicit type casts. > tradein_clients=# > > -- -Achilleus ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Constraint->function dependency and dump in 7.3
Dear Fellow Countymen, I fear none of your answers are acceptable for me. Also, from Csaba's answer, this sounds to me more like a bug in pg_dump v7.3. (1) I wish to transfer the full dump for daily mirroring. Thus, data-only isn't an option. (2) Dumping functions first won't work for SQL functions that refer to tables. Separating them sounds painful. (3) Never used pg_restore, but having a look at it, it doesn't seem to be any better for me than a hand-made repair script G. %--- cut here ---% \end - Original Message - From: "Verebes Gabor" <[EMAIL PROTECTED]> Sent: Friday, July 09, 2004 5:34 PM Hi! Why don't you use pg_restore. You can set the order of restoring with parameters. (I haven't tried) By, Gabor -Original Message- From: [EMAIL PROTECTED] Sent: Friday, July 09, 2004 7:15 AM Hi Gábor! I had the same problem and someone pointed me the right direction. I tried to define a table default clause refering a function. Reloading the dump file an error messaged raised up saying that the referred function doesn't exist. This is because dumping out the schema pg_dump pushes out the table definitions first and then the functions (I don't know why can not realize these issues.). You can keep the schema dump in a separete file and move the referred functions in front of the tble definitions. After that regulary dump out only the data. Restoing the db start with the schema file. I hope I was clear. Another advance of this method is that it is absolutely Y3K safe. :) Bye, -- Csaba Együd > -Original Message- > From: [EMAIL PROTECTED] > Sent: 2004. július 8. 13:10 > Subject: [SQL] Constraint->function dependency and dump in 7.3 > > > Dear Gurus, > > Just recently realized that our daily dump from a 7.3 > (production) db to a > 7.4 (development) server has problems. I have no idea where > to search for an > answer so please feel free to point me to the appropriate > thread, doc or TFM > :) > > Below is two portions of the dump, which seems to be in the > wrong order (at > least for me). I'm not sure, and not in a position to easily > test it, that > it's wrong order in 7.3; but 7.4 has problems creating the > table without the > function (which is logical): > > %--- cut here ---% > CREATE TABLE cim ( > -- etc etc ... > orszag_kod integer, > CONSTRAINT cim_orszag_kod CHECK ((hely_fajta(orszag_kod) = 7)) > ); > > -- ... several lines later: > > CREATE FUNCTION hely_fajta (integer) RETURNS integer > AS ' ... ' > LANGUAGE sql; > %--- cut here ---% > > Checked pg_depend, and constraint cim_orszag_kod refers to function > hely_fajta, but noone (not even the table) refers to the > constraint. I'm > just wondering if it's ok... > > 1) is it normal that the table does not refer to its constraints? > 2) if not, do you have the idea of the possible cause? > 3) if so, is it normal for pg_dump to dump in this order? > 4) if so, how may I change it? > 5) may inserting into pg_depend solve the problem? > > TIA, > G. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [SQL] Comparing tsearch2 vectors.
Dear Mantzios, I have to get set of banners from database in response to a search term. I want that the search term be compared to the keyword corresponding to the banners stored in database. current i am doing an equality match but i woild like to do it after stemming both the sides (serch term and keywords). So that the banners for the adword say 'incense exporter' is shown even if 'incenses exporter' or 'incense exporters' is searched. I hope i am able to clarify. Regds Mallah. Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Hi, We want to compare strings after stemming. Can anyone tell me what is the best method. I was thinking to compare the tsvector ,but there is no operator for that. I'd tokenize each string and then apply lexize() to get the equivalent stemified word, but what exactly are you trying to accomplish? Regds Mallah. tradein_clients=# SELECT to_tsvector('handicraft exporters'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 710.315 ms tradein_clients=# tradein_clients=# SELECT to_tsvector('handicrafts exporter'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 400.679 ms tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); ERROR: operator does not exist: tsvector = tsvector HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. tradein_clients=# -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---+ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [SQL] Constraint->function dependency and dump in 7.3
On Mon, 2004-07-12 at 08:29, SZŰCS Gábor wrote: > Dear Fellow Countymen, > > I fear none of your answers are acceptable for me. Also, from Csaba's > answer, this sounds to me more like a bug in pg_dump v7.3. It is a bug (or a missing feature) that should be solved with v7.5 for restoring to 7.5 or later database. Until then, you'll need to re-order the dump by hand (splitting data from schema can be useful). ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Comparing tsearch2 vectors.
O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > > > Dear Mantzios, > > I have to get set of banners from database in > response to a search term. I want that the search term > be compared to the keyword corresponding to the > banners stored in database. current i am doing an > equality match but i woild like to do it after stemming > both the sides (serch term and keywords). You could transform your search terms so that there is the "&" separator between them. (& stands for "AND"). E.g. "handicrafts exporter" becomes "handicrafts&exporter" And then select * from where idxfti @@ to_tsquery(); where idxfti is your tsvector column. E.g. # SELECT to_tsvector('handycrafts exporters') @@ to_tsquery('handycraft&exporting'); ?column? -- t (1 row) > > So that the banners for the adword say 'incense exporter' is > shown even if 'incenses exporter' or 'incense exporters' is > searched. > > I hope i am able to clarify. > > Regds > Mallah. > > Achilleus Mantzios wrote: > > >O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > > > > > > > >>Hi, > >> > >>We want to compare strings after stemming. Can anyone > >>tell me what is the best method. I was thinking to compare > >>the tsvector ,but there is no operator for that. > >> > >> > > > >I'd tokenize each string and then apply lexize() to get the > >equivalent stemified > >word, but what exactly are you trying to accomplish? > > > > > > > >>Regds > >>Mallah. > >> > >> > >> > >>tradein_clients=# SELECT to_tsvector('handicraft exporters'); > >>+---+ > >>|to_tsvector| > >>+---+ > >>| 'export':2 'handicraft':1 | > >>+---+ > >>(1 row) > >> > >>Time: 710.315 ms > >>tradein_clients=# > >>tradein_clients=# SELECT to_tsvector('handicrafts exporter'); > >>+---+ > >>|to_tsvector| > >>+---+ > >>| 'export':2 'handicraft':1 | > >>+---+ > >>(1 row) > >> > >>Time: 400.679 ms > >>tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); > >>ERROR: operator does not exist: tsvector = tsvector > >>HINT: No operator matches the given name and argument type(s). You may > >>need to add explicit type casts. > >>tradein_clients=# > >> > >> > >> > >> > > > > > > > > > -- -Achilleus ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Constraint->function dependency and dump in 7.3
Dear Gabor, I meant that if the schema of the given database is not altered frequently it can be a considerable solution keeping the schema in a separate file. When it is altered you must make a new one, but just once per schema modifications. I don't think that it is a painful thing to write a script which reloads the schema first and then the daily (or whatever) data-only dump file. In this approach you have to maintain two files during the restore process - or if it is a problem, you can append the data dump to a copy of the schema file. cheers, -- Csaba > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of SZŰCS Gábor > Sent: 2004. július 12. 14:30 > To: [EMAIL PROTECTED] > Subject: Re: [SQL] Constraint->function dependency and dump in 7.3 > > > Dear Fellow Countymen, > > I fear none of your answers are acceptable for me. Also, from Csaba's > answer, this sounds to me more like a bug in pg_dump v7.3. > > (1) I wish to transfer the full dump for daily mirroring. > Thus, data-only > isn't an option. > > (2) Dumping functions first won't work for SQL functions that refer to > tables. Separating them sounds painful. > > (3) Never used pg_restore, but having a look at it, it > doesn't seem to be > any better for me than a hand-made repair script > > G. > %--- cut here ---% > \end > > - Original Message - > From: "Verebes Gabor" <[EMAIL PROTECTED]> > Sent: Friday, July 09, 2004 5:34 PM > > > Hi! > > Why don't you use pg_restore. You can set the order of restoring with > parameters. > (I haven't tried) > > By, > Gabor > > > -Original Message- > From: [EMAIL PROTECTED] > Sent: Friday, July 09, 2004 7:15 AM > > > Hi Gábor! > > I had the same problem and someone pointed me the right > direction. I tried > to define a table default clause refering a function. > Reloading the dump > file an error messaged raised up saying that the referred > function doesn't > exist. > This is because dumping out the schema pg_dump pushes out the table > definitions first and then the functions (I don't know why > can not realize > these issues.). You can keep the schema dump in a separete > file and move the > referred functions in front of the tble definitions. After > that regulary > dump out only the data. Restoing the db start with the schema file. > > I hope I was clear. Another advance of this method is that it > is absolutely > Y3K safe. :) > > Bye, > -- Csaba Együd > > > -Original Message- > > From: [EMAIL PROTECTED] > > Sent: 2004. július 8. 13:10 > > Subject: [SQL] Constraint->function dependency and dump in 7.3 > > > > > > Dear Gurus, > > > > Just recently realized that our daily dump from a 7.3 > > (production) db to a > > 7.4 (development) server has problems. I have no idea where > > to search for an > > answer so please feel free to point me to the appropriate > > thread, doc or TFM > > :) > > > > Below is two portions of the dump, which seems to be in the > > wrong order (at > > least for me). I'm not sure, and not in a position to easily > > test it, that > > it's wrong order in 7.3; but 7.4 has problems creating the > > table without the > > function (which is logical): > > > > %--- cut here ---% > > CREATE TABLE cim ( > > -- etc etc ... > > orszag_kod integer, > > CONSTRAINT cim_orszag_kod CHECK ((hely_fajta(orszag_kod) = 7)) > > ); > > > > -- ... several lines later: > > > > CREATE FUNCTION hely_fajta (integer) RETURNS integer > > AS ' ... ' > > LANGUAGE sql; > > %--- cut here ---% > > > > Checked pg_depend, and constraint cim_orszag_kod refers to function > > hely_fajta, but noone (not even the table) refers to the > > constraint. I'm > > just wondering if it's ok... > > > > 1) is it normal that the table does not refer to its constraints? > > 2) if not, do you have the idea of the possible cause? > > 3) if so, is it normal for pg_dump to dump in this order? > > 4) if so, how may I change it? > > 5) may inserting into pg_depend solve the problem? > > > > TIA, > > G. > > > ---(end of > broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so > that your > message can get through to the mailing list cleanly > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.717 / Virus Database: 473 - Release Date: 2004. 07. 08. > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.717 / Virus Database: 473 - Release Date: 2004. 07. 08. ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Comparing tsearch2 vectors.
Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Dear Mantzios, I have to get set of banners from database in response to a search term. I want that the search term be compared to the keyword corresponding to the banners stored in database. current i am doing an equality match but i woild like to do it after stemming both the sides (serch term and keywords). You could transform your search terms so that there is the "&" separator between them. (& stands for "AND"). E.g. "handicrafts exporter" becomes "handicrafts&exporter" And then select * from where idxfti @@ to_tsquery(); But i do not want 'handicraft exporters of delhi' to pop out if i search for 'handicrafts exporters' whereas SELECT to_tsvector('handycrafts exporters of delhi') @@ to_tsquery('handycraft&exporting'); will be true. Regds Mallah. where idxfti is your tsvector column. E.g. # SELECT to_tsvector('handycrafts exporters') @@ to_tsquery('handycraft&exporting'); ?column? -- t (1 row) So that the banners for the adword say 'incense exporter' is shown even if 'incenses exporter' or 'incense exporters' is searched. I hope i am able to clarify. Regds Mallah. Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Hi, We want to compare strings after stemming. Can anyone tell me what is the best method. I was thinking to compare the tsvector ,but there is no operator for that. I'd tokenize each string and then apply lexize() to get the equivalent stemified word, but what exactly are you trying to accomplish? Regds Mallah. tradein_clients=# SELECT to_tsvector('handicraft exporters'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 710.315 ms tradein_clients=# tradein_clients=# SELECT to_tsvector('handicrafts exporter'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 400.679 ms tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); ERROR: operator does not exist: tsvector = tsvector HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. tradein_clients=# -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---+ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [SQL] Secure DB Systems - How to
Sarah Tanembaum wrote: I was wondering if it is possible to create a secure database system usingPostgreSQL/PHP combination? I have the following in mind: I wanted to store all my( and my brothers and sisters) important document information such as birth certificate, SSN, passport number, travel documents, insurance(car, home, etc) document, and other important documents imagined in the database. The data will be entered either manually and/or scanned(with OCR). I need to be able to search on all the fields in the database. We have 10 computers(5bros, 4sisters, and myself) plus 1 server with I maintained. The data should be synchronize/replicate between those computers. Well, so far it is easy, isn't it? Here's my question: a) How can I make sure that it secure so only authorized person can modify/add/delete the information? Beside transaction logs, are there any other method to trace any transaction(kind of paper trail)? There can be multiple solutions to your problem. The security and logging may be implemented either at database level or application level. That is a call you have to take. If you consider the database to take care of security and logging you could do the following. 1. create a database user for each of your family members 2. ask the memebers to login to your application using their own id. 3. Use that id for connecting to the database using php. the security at table level can be managed by various GRANT commands. the security at row level can be done using a mechanism methods describe in the -general mailling list (search: "row level grants"). For logging changes to your tables you can create audit trail of all the tables in question by using triggers or enbale logging of sql statements (with current user display) in postgresql server. u may consider: http://gborg.postgresql.org/project/audittrail/projdisplay.php although i have not used it myself. Assuming there are 3 step process to one enter the info e.g: - One who enter the info (me) - One who verify the info(the owner of info) - One who verify and then commit the change! How can I implement such a process in PostgreSQL and/or PHP or any other web language? I think such a moderation should be implemented at application level. b) How can I make sure that no one can tap the info while we are entering the data in the computer? (our family are scattered within US and Canada) you may run yor web application using https:// rather than http:// and you may enable ssl in postgresql for securing the communication between application and database. c) Is it possible to securely synchronize/replicate between our computers using VPN? Does PostgreSQL has this functionality by default? Slony and many other replication solution exists for asyncronous replication. Hope it helps a bit. Regds Mallah. d) Other secure method that I have not yet mentioned. Anyone has good ideas on how to implement such a systems? Thanks ---(end of broadcast)--- TIP 8: explain analyze is your friend -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---+ ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [SQL] Comparing tsearch2 vectors.
O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > Achilleus Mantzios wrote: > > >O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > > > > > > > >>Dear Mantzios, > >> > >>I have to get set of banners from database in > >>response to a search term. I want that the search term > >>be compared to the keyword corresponding to the > >>banners stored in database. current i am doing an > >>equality match but i woild like to do it after stemming > >>both the sides (serch term and keywords). > >> > >> > > > >You could transform your search terms so that there is the "&" > >separator between them. (& stands for "AND"). > >E.g. "handicrafts exporter" becomes "handicrafts&exporter" > >And then > >select * from where idxfti @@ to_tsquery(); > > > > > > But i do not want 'handicraft exporters of delhi' to pop out if i search > for 'handicrafts exporters' whereas > > SELECT to_tsvector('handycrafts exporters of delhi') @@ > to_tsquery('handycraft&exporting'); > > will be true. Define what you want, and then read tsearch2 userguide. I'm sure you'll find your way :) > > Regds > Mallah. > > > > >where idxfti is your tsvector column. > > > >E.g. > ># SELECT to_tsvector('handycrafts exporters') @@ to_tsquery('handycraft&exporting'); > > ?column? > >-- > > t > >(1 row) > > > > > > > > > > > >>So that the banners for the adword say 'incense exporter' is > >>shown even if 'incenses exporter' or 'incense exporters' is > >>searched. > >> > >>I hope i am able to clarify. > >> > >>Regds > >>Mallah. > >> > >>Achilleus Mantzios wrote: > >> > >> > >> > >>>O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : > >>> > >>> > >>> > >>> > >>> > Hi, > > We want to compare strings after stemming. Can anyone > tell me what is the best method. I was thinking to compare > the tsvector ,but there is no operator for that. > > > > > >>>I'd tokenize each string and then apply lexize() to get the > >>>equivalent stemified > >>>word, but what exactly are you trying to accomplish? > >>> > >>> > >>> > >>> > >>> > Regds > Mallah. > > > > tradein_clients=# SELECT to_tsvector('handicraft exporters'); > +---+ > |to_tsvector| > +---+ > | 'export':2 'handicraft':1 | > +---+ > (1 row) > > Time: 710.315 ms > tradein_clients=# > tradein_clients=# SELECT to_tsvector('handicrafts exporter'); > +---+ > |to_tsvector| > +---+ > | 'export':2 'handicraft':1 | > +---+ > (1 row) > > Time: 400.679 ms > tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); > ERROR: operator does not exist: tsvector = tsvector > HINT: No operator matches the given name and argument type(s). You may > need to add explicit type casts. > tradein_clients=# > > > > > > > >>> > >>> > >>> > >>> > >> > >> > >> > > > > > > > > > -- -Achilleus ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[SQL] Order of execution of rules
Can I guarantee that if I have more than one Rule on a table they will be executed in a given order? I know triggers are done alphabetically but is the same true of rules? Many thanks Hilary Hilary Forbes The DMR Information and Technology Group (www.dmr.co.uk) Direct tel 01689 889950 Fax 01689 860330 DMR is a UK registered trade mark of DMR Limited ** ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [SQL] Order of execution of rules
Hilary Forbes mentioned : => Can I guarantee that if I have more than one Rule on a table they will be executed in a given order? I know triggers are done alphabetically but is the same true of rules? http://www.postgresql.org/docs/7.4/static/sql-createrule.html#AEN37748 pgpgCnrDhs4Og.pgp Description: PGP signature
Re: [SQL] Comparing tsearch2 vectors.
Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Dear Mantzios, I have to get set of banners from database in response to a search term. I want that the search term be compared to the keyword corresponding to the banners stored in database. current i am doing an equality match but i woild like to do it after stemming both the sides (serch term and keywords). You could transform your search terms so that there is the "&" separator between them. (& stands for "AND"). E.g. "handicrafts exporter" becomes "handicrafts&exporter" And then select * from where idxfti @@ to_tsquery(); But i do not want 'handicraft exporters of delhi' to pop out if i search for 'handicrafts exporters' whereas SELECT to_tsvector('handycrafts exporters of delhi') @@ to_tsquery('handycraft&exporting'); will be true. Define what you want, and then read tsearch2 userguide. I'm sure you'll find your way :) The requirement is different than full text search. I am not searching a word in a collection of words (text) rather comparing two strings after all the words in those strings are stemmed. Hope my requirement is clear now. Regds mallah. Regds Mallah. where idxfti is your tsvector column. E.g. # SELECT to_tsvector('handycrafts exporters') @@ to_tsquery('handycraft&exporting'); ?column? -- t (1 row) So that the banners for the adword say 'incense exporter' is shown even if 'incenses exporter' or 'incense exporters' is searched. I hope i am able to clarify. Regds Mallah. Achilleus Mantzios wrote: O kyrios Rajesh Kumar Mallah egrapse stis Jul 12, 2004 : Hi, We want to compare strings after stemming. Can anyone tell me what is the best method. I was thinking to compare the tsvector ,but there is no operator for that. I'd tokenize each string and then apply lexize() to get the equivalent stemified word, but what exactly are you trying to accomplish? Regds Mallah. tradein_clients=# SELECT to_tsvector('handicraft exporters'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 710.315 ms tradein_clients=# tradein_clients=# SELECT to_tsvector('handicrafts exporter'); +---+ |to_tsvector| +---+ | 'export':2 'handicraft':1 | +---+ (1 row) Time: 400.679 ms tradein_clients=# SELECT to_tsvector('Hi there') = to_tsvector('Hi there'); ERROR: operator does not exist: tsvector = tsvector HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. tradein_clients=# -- regds Mallah. Rajesh Kumar Mallah +---+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---+ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org