title: How to get only the table names of a database in PostgreSQL
body: <p>I have a couple of bash scripts that query a mysql database and get the table names, I use the following command:</p>
  
  <pre><code>mysql -NBA --user=$DB_user --password=$DB_pass --database=$DB_name -e 'show tables'
  </code></pre>
  
  <p>With the -NBA parameters I filter the result and get something like this:</p>
  
  <pre><code>    categories
      colections
      colors
      files
  </code></pre>
  
  <p>In postgreSQL with psql I'm trying to achieve the same format, I'm reading the documentation and using the following parameters:</p>
  
  <pre><code>psql --username=$DB_user -W --host=$HOST --dbname=$DB_name -Atc '\dt'
  </code></pre>
  
  <p>An this is the best I can get</p>
  
  <pre><code>    public|categories|table|user
      public|colections|table|dbuser
      public|colors|table|dbuser
      public|files|table|dbuser
  </code></pre>
  
  <p>In the worst case I need to parse this to get only the names of the table, but if someone know the way to achieve what I want I be glad.</p>