Skip to content


DDC-2608: Wrong SQL generated for @SequenceGenerator, throws Exception #3339

doctrinebot opened this Issue · 1 comment

2 participants


Jira issue originally created by user dowlci:

I'm using Doctrine2 v2.3.4 and PostgreSQL.

I created an entity with this:

 * @Id
 * @Column(type="integer")
 * @GeneratedValue
 * @SequenceGenerator(allocationSize=100)
 * @var integer
protected $id;

And then run orm:schema-tool:update --force. But the sequence name is missing in the SQL and I get this error:

  An exception occurred while executing 'CREATE SEQUENCE  INCREMENT BY 100 MINVALUE 1 START 1':  

  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "BY"                          
  LINE 1: CREATE SEQUENCE  INCREMENT BY 100 MINVALUE 1 START 1                                   

Adding sequenceName="tablename_seq" fixes it.


Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.3.5 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.