B
B
BonBon Slick2017-12-09 16:31:01
PostgreSQL
BonBon Slick, 2017-12-09 16:31:01

Why do we need SEQUENCE for Id under PostgreSQL?

docs.doctrine-project.org/en/latest/reference/basi...
One of the primary key definition types.
What does it give? Why and why? Worth using or not? Why?
I noticed that Doctrine 2 automatically creates this partition in the database. However, it is not entirely clear why this is, and what additional configs give to this parameter.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lexey Felde, 2017-12-10
@BonBonSlick

You can always use the AUTO strategy as it is cross platform. For PostgreSQL, sequence generators named {entityName}_{columnName}_seq will automatically be used . I think that after reading the documentation everything will become clear.
Is it worth using? Only if for the purity of the code, if the project is hard-wired to PostgreSQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question