Refactoring : PostgreSQL