PostgreSQL database abstraction layer