Automating more postgres