title: PostgreSQL select all from one table and join count from table relation
body: <p>I have two tables, <code>post_categories</code> and <code>posts</code>. I'm trying to <code>select * from post_categories;</code>, but also return a temporary column with the count for each time a post category is used on a post.</p>
  
  <p><strong>Posts</strong></p>
  
  <pre><code>| id | name | post_category_id |
  | 1  | test | 1                |
  | 2  | nest | 1                |
  | 3  | vest | 2                |
  | 4  | zest | 3                |
  </code></pre>
  
  <p><strong>Post Categories</strong></p>
  
  <pre><code>| id | name  |
  | 1  | cat_1 |
  | 2  | cat_2 |
  | 3  | cat_3 |
  </code></pre>
  
  <p>Basically, I'm trying to do this without subqueries and with joins instead. Something like this, but in real <code>psql</code>.</p>
  
  <p><code>select * from post_categories some-type-of-join posts, count(*)</code></p>
  
  <p>Resulting in this, ideally.</p>
  
  <pre><code>| id | name  | count |
  | 1  | cat_1 | 2     |
  | 2  | cat_2 | 1     |
  | 3  | cat_3 | 1     |
  </code></pre>
  
  <p>Your help is greatly appreciated :D</p>