Fixed problem with postgresql adapter