From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rohit Suman <handsome_94@yahoo.com>
Cc: pavel.stehule@gmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Fw: ERROR: operator does not exist: date ~~ unknown
Date: Sun, 12 Apr 2009 11:16:49 -0400
Message-ID: <25843.1239549409@sss.pgh.pa.us> (raw)
In-Reply-To: <763646.95021.qm@web33107.mail.mud.yahoo.com>
References: <763646.95021.qm@web33107.mail.mud.yahoo.com>
Rohit Suman <handsome_94@yahoo.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, handsome_94@yahoo.com, pavel.stehule@gmail.com
Subject: Re: Fw: ERROR: operator does not exist: date ~~ unknown
In-Reply-To: <25843.1239549409@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox