Add support for PostgreSQL history