title: How to create a PostgreSQL partitioned sequence?
body: <p>Is there a simple (ie. non-hacky) and race-condition free way to create a partitioned sequence in PostgreSQL. Example:</p>
  
  <p>Using a normal sequence in Issue:</p>
  
  <pre><code>| Project_ID | Issue |
  | 1          | 1     |
  | 1          | 2     |
  | 2          | 3     |
  | 2          | 4     |
  </code></pre>
  
  <p>Using a partitioned sequence in Issue:</p>
  
  <pre><code>| Project_ID | Issue |
  | 1          | 1     |
  | 1          | 2     |
  | 2          | 1     |
  | 2          | 2     |
  </code></pre>