added PostgreSQL functions