Hi,
 
Please find patch for bug described in this link,
 
http://www.postgresql.org/message-id/54ABF43A.7030809@ifortuna.cz
 
regards,
Prasad