Updated to be compatible with PostgreSQL 9.2.