Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 96084632D5E for ; Sun, 12 Apr 2009 12:16:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85443-04 for ; Sun, 12 Apr 2009 12:16:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C49E7632B79 for ; Sun, 12 Apr 2009 12:16:51 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n3CFGojQ025844; Sun, 12 Apr 2009 11:16:50 -0400 (EDT) To: Rohit Suman cc: pavel.stehule@gmail.com, pgsql-sql@postgresql.org Subject: Re: Fw: ERROR: operator does not exist: date ~~ unknown In-reply-to: <763646.95021.qm@web33107.mail.mud.yahoo.com> References: <763646.95021.qm@web33107.mail.mud.yahoo.com> Comments: In-reply-to Rohit Suman message dated "Sun, 12 Apr 2009 02:50:22 -0700" Date: Sun, 12 Apr 2009 11:16:49 -0400 Message-ID: <25843.1239549409@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/57 X-Sequence-Number: 32403 Rohit Suman writes: > Ya...I simply changed column type to text and it worked. :D > I had requirements where I needed such a functionality. There was no way to do it any other way... You should really, really take a second look at those "requirements". Applying a textual pattern match to a date is a horrid idea for a number of reasons, most notably that it's just about certain to break if someone changes DateStyle. Think about what it is you really want to do (select a particular year, perhaps?) and see if there's not a datetime-based operation that does it. regards, tom lane