Postgresql alter type serial




















We can store up to 2, , , number in our table by using a serial data type. If we use bigserial, then the range of this serial data type is 1 to 9, , , , , , and storage size is 8 bytes. PostgreSQL serial data type is used to define the auto increment number of column in a table; PostgreSQL serial will generate a serial sequence of integer numbers.

You may also have a look at the following articles to learn more —. Submit Next Question. By signing up, you agree to our Terms of Use and Privacy Policy. Forgot Password? This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. It is indeed an integer so you already have half of it. What is missing is to assign the sequence as the default value:. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Alter data type of a column to serial postgresql [duplicate] Ask Question. Asked 4 years, 10 months ago. Active 4 years, 10 months ago. Viewed 11k times. Improve this question. Kamfasage Kamfasage 1 1 gold badge 4 4 silver badges 14 14 bronze badges. See also Adding 'serial' to existing column in Postgres , and a lot more Add a comment.

Active Oldest Votes. Improve this answer.



0コメント

  • 1000 / 1000