title: Sequence does not exist when it does - Postgres/Spring Boot
body: <p>I am writing a Spring Boot web-app and using a Postgres db to persist my data. I created a table in Postgres using <code>create table user (id bigserial primary key not null, name text not null;</code> and identified its <code>sequence_name</code> by looking at the schema (in this case, it is <code>user_id_seq</code>). Then, in my <code>User</code> entity class in Spring Boot, I added the following:</p>
  
  <pre><code>@Entity
  @Table(name = "user")
  public class User implements Serializable {
  
      @Id
      @SequenceGenerator(name = "user_local_seq", sequenceName = "user_id_seq", allocationSize = 1)
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_local_seq")
      private Long id;
  ...
  </code></pre>
  
  <p>making sure that the <code>sequenceName</code> matches what I saw earlier. Now when I start my spring boot app, I am able to successfully boot it but I get the following "error" in the trace:</p>
  
  <pre><code>main] org.hibernate.tool.hbm2ddl.SchemaExport  : ERROR: sequence "user_id_seq" does not exist
  </code></pre>
  
  <p>I killed the app and started it again and this time, I got:</p>
  
  <pre><code>main] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000389: Unsuccessful: drop sequence user_id_seq
  main] org.hibernate.tool.hbm2ddl.SchemaExport  : ERROR: sequence "user_id_seq" does not exist
  </code></pre>
  
  <p>What does this mean? Am I missing something? Any help/insight is appreciated.</p>