Finally I found the culprit. It was a funny postgres sql query. :-). Are you able to find the difference between the two queries?
insert into testtest values (to_timestamp('2009-11-11 05:32:46','yyyy-MM-dd HH:MI:SS'))
insert into testtest values (to_timestamp('2009-11-11 05:32:46','yyyy-MM-dd HH:MI:SS'))
Actually both the queries are same, but in first query there is a line break in the format.
Query 1
On executing the first query the data inserted was "2009-11-11 02:46:00". Difference of seconds, shifted to minutes and that of minutes to hours.
Query 2
On executing the second query, I got the expected normal result. "2009-11-11 05:32:46".
I felt this little bit weird, but so relieved after finding the problem. We were storing all the queries in XML file and did a XML formatting of the file. So every query was indented with proper line breaks.
0 comments
Post a Comment