title: ERROR: more than one owned sequence found in Postgres
body: <p>I'm setting up a identity column to my existing columns for the <code>Patient</code> table.<br>
  Here I would like to use <strong>GENERATED ALWAYS AS IDENTITY</strong>.</p>
  
  <p>So I setup the identity column by using the following statement (previously it was <code>serial</code>):</p>
  
  <pre><code>ALTER TABLE Patient ALTER PatientId
     ADD GENERATED ALWAYS AS IDENTITY (START WITH 1);
  </code></pre>
  
  <p>For the existing patient table I have a total of 5 records. (<code>patientId</code> 1 to 5)<br>
  When I insert a new record after the identity setup, it will throw an error like:</p>
  
  <pre><code>more than one owned sequence found
  </code></pre>
  
  <p>Even after resetting the identity column, I still get the same error.</p>
  
  <pre><code>ALTER TABLE Patient ALTER COLUMN PatientId RESTART WITH 6;
  </code></pre>
  
  <p>Let me know if you have any solutions.</p>