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

From: Rohit Suman <handsome_94(at)yahoo(dot)com>
To: pavel(dot)stehule(at)gmail(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Fw: ERROR: operator does not exist: date ~~ unknown
Date: 2009-04-12 09:50:22
Message-ID: 763646.95021.qm@web33107.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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...

Thanks man

----- Forwarded Message ----
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Rohit Suman <handsome_94(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Sent: Sunday, 12 April, 2009 1:06:16 PM
Subject: Re: [SQL] ERROR: operator does not exist: date ~~ unknown

Hello

it means - there are not operator LIKE for datatype date. Why do you
do it? Try to look on date_part or extract functions.

Fast solution, bot not optimal, is cast date to text via function
to_char(date, 'mask')

regards
Pavel Stehule

2009/4/12 Rohit Suman <handsome_94(at)yahoo(dot)com>:
> Hi
>
> I've a table bins in which I've a column named "Date In" which stores
> values of "Date" type. I've postgresql 8.3.5
>
> Now when I execute query " select * from bins where "Date In" like '%'; " I
> get the folowing error :
>
>
> SQL error:
>
> ERROR: operator does not exist: date ~~ unknown
> LINE 1: select * from bins where "Date In" like '%';
> ^
> HINT: No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
>
> In statement:
> select * from bins where "Date In" like '%';
>
> Please help...I'm stuck for like 3-4 hours now on this X_X
>
> Rohit
>
> ________________________________
> Add more friends to your messenger and enjoy! Invite them now.

Get perfect Email ID for your Resume. Grab now http://in.promos.yahoo.com/address

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-04-12 15:16:49 Re: Fw: ERROR: operator does not exist: date ~~ unknown
Previous Message Pavel Stehule 2009-04-12 07:36:16 Re: ERROR: operator does not exist: date ~~ unknown