Refactoring : postgre compliance