There has been a previous discussion about this topic, including an attempted fix by Amit Kapila:http://www.postgresql.org/message-id/flat/CAA4eK1L=tHmmHDK_KW_ja1_dusJxJF+SGQHi=APS4MdNPk7HFQ(at)mail(dot)gmail(dot)com/