Re: Fw: ERROR: operator does not exist: date ~~ unknown

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fw: ERROR: operator does not exist: date ~~ unknown
Дата
Msg-id 25843.1239549409@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Fw: ERROR: operator does not exist: date ~~ unknown  (Rohit Suman <handsome_94@yahoo.com>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Rohit Suman
Дата:
Сообщение: Fw: ERROR: operator does not exist: date ~~ unknown
Следующее
От: Dirk Jagdmann
Дата:
Сообщение: Re: ENUM vs DOMAIN vs FKyed loookup table