How do I list all databases and tables using psql in a pipable format? This question deals with getting a list. So I get this:

$ psql --list
                                    List of databases
      Name      |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
----------------+----------+----------+-------------+-------------+-----------------------
 testdb1        | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 odoo           | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 odoo-demo      | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 odoo8          | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |


I could use psql --list|grep UTF8|awk '{ print $1 }' to get a list of just the databases. Can psql also give me a clean useful list directly?
psql -q -A -t -c "SELECT datname FROM pg_database" does the trick.