postgresql; bug fixes; performance optimization