The attached patch file adds support for the PostgreSQL database.