title: How to get the existing postgres databases in a list
body: <p>I am trying to write a python script to automate the task of creating database using the most recent production dump. I am using psychopg2 for the purpose.</p>
  
  <p>But after the creation of the new database I want to delete the previously used database. My idea is that if I could get the names of databases in a list and sort them, I can easily delete the unwanted database.</p>
  
  <p>So, my question is : How can I get the names of the DBs in a list.</p>
  
  <p>Thanks</p>