title: postgres making a primary key string+integer
body: <p>I want to make a primary key like:</p>
  
  <pre><code>ABCD000012018, ABCD000022018, ABCD000032018
  </code></pre>
  
  <p>and reset to 00001 every year, so in 2019 it will become <strong>ABCD000012019</strong></p>
  
  <p>So </p>
  
  <ul>
  <li>what is the best way of doing it.</li>
  <li>should i make another table to store counter and year parts.</li>
  <li>if i made other table then shoud i automatically reset year and counter (then i have to depend on server date and time) OR set counter and year manually.</li>
  </ul>