fix postgresql adapter code