Re: Why is there a tsquery data type?

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why is there a tsquery data type?
Date: 2007-08-30 06:32:28
Message-ID: 87642xbkhv.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Bruce Momjian" <bruce(at)momjian(dot)us> writes:

> There is no question things would be clearer with only one text search
> data type. The only value I can see to having a tsquery data type is
> that you can store a tsquery value in a column, but why would that be
> much better than just storing it in a TEXT field?

When you try storing a tsquery in a column does it alert you if you have an
invalid syntax at that point? Storing it as text would mean not finding out
until you try to use the query.

Is converting a text query into the internal format faster or less memory
intensive than converting text into the internal representation? When you run
a query like "WHERE '...' @@ col" if there wasn't a tsquery data type then
'...' would have to be parsed over and over again for each row.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2007-08-30 08:05:04 Re: msvc++ build of 8.2.4 and encodings
Previous Message NikhilS 2007-08-30 06:01:02 Re: StringInfo misc. issues