title: How do I discover the structure of a PostgreSQL database?
body: <p>I need to write a script that will output data from a PostgreSQL database that I do not know the structure of. What query will return the names of all tables in a database? And what query will list the names of all columns in a table?</p>