Updated for PostgreSQL 9.2