fix bug on PostgreSQL 9.2.x