Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 070849F9528 for ; Thu, 30 Aug 2007 03:33:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 68329-02 for ; Thu, 30 Aug 2007 03:33:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id 32ED79F9489 for ; Thu, 30 Aug 2007 03:32:51 -0300 (ADT) Received: from localhost.enta.net ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1IQdZt-0001e3-4i; Thu, 30 Aug 2007 07:32:29 +0100 To: "Bruce Momjian" Cc: "Tom Lane" , "PostgreSQL-development" Subject: Re: Why is there a tsquery data type? In-Reply-To: <200708300103.l7U13lr15346@momjian.us> (Bruce Momjian's message of "Wed\, 29 Aug 2007 21\:03\:47 -0400 \(EDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.hackers" 12814) References: <200708300103.l7U13lr15346@momjian.us> From: Gregory Stark Organization: EnterpriseDB Date: Thu, 30 Aug 2007 07:32:28 +0100 Message-ID: <87642xbkhv.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/1107 X-Sequence-Number: 107029 "Bruce Momjian" 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