I have a problem with snprintf function which insert the variables to string with error. This code I wrote for PostgreSQL 8.3.7 on Fedora 10 and it worked fine. But now I use CentOS 5.3 and PostgreSQL 8.3.8.
Result: select calculateaccount(123, '01-01-2009', '01-02-2009'); INFO: '2009-01-01' INFO: '2009-02-01' INFO: SELECT serviceId, periodStartDate, periodEndDate FROM accountServiceBaseView WHERE accountId = 123 AND periodStartDate <= (null) AND periodEndDate >= '2009-01-01';
If I change the order of parameters to "periodStartDate <= %s AND periodEndDate >= %s AND accountId = %ld", all works fine. Unfortunately this method can not be applied to other functions of my module.