Getting the to_date error function (timestamp without time zone, unknown) does not exist

I recently migrated my postgres from 8.2 to 8.4. when i run my application and try login i get this error

 ERROR [JDBCExceptionReporter] ERROR: function to_date(timestamp without time zone, unknown) does not exist

I checked in my postgres by excluding this to_date function

SELECT  to_date(createddate,'YYYY-MM-DD') FROM  product_trainings;

it gives me an error function to_date does not exist

when i execute the same request in postgres 8.2 i don't get error

Please help me solve this problem.

+4
source share
2 answers

It seems that all he needs is a conversion from a timestamp to text, since the function definition is: to_date (text, text).

, 8.2 .

http://www.postgresql.org/docs/8.4/static/functions-formatting.html

+5

.

SELECT
    to_date(cast(createddate as TEXT),'YYYY-MM-DD') 
FROM  
    product_trainings;
+7

All Articles