title: Use max value of a column to restart postgresql sequence
body: <p>I need to restart the table sequence after manually importing data and want to dynamically use the maximum value (+1) currently present in the id column.</p>
  
  <p>I identify the value with</p>
  
  <pre><code>SELECT coalesce(MAX("id")+1) FROM "termine";
  </code></pre>
  
  <p>And I update the sequence with</p>
  
  <pre><code>ALTER SEQUENCE termine_id_seq RESTART WITH 123;
  </code></pre>
  
  <p>How can I use the MAX id within the ALTER instead of the "123"?</p>