make it work with postgresql