completed switch to postgresql/pdo