Refactor postgres commands.