ALTER postgreSQL sequence

跟風遠走 提交于 2019-12-12 06:46:01

问题


I am quite very new to postgreSQL. I am have a sequence which starts from 1 by default. What I am looking for is that if I want to move my next value, which is now 87, to 2000. I am unable to do that. Can any one suggest me how to go about doing the change?


回答1:


You can ALTER the sequence using the following code:

ALTER SEQUENCE seq_name RESTART 2000.

I request you to please go through the postgres SQL manuals.

http://www.postgresql.org/docs/current/static/sql-altersequence.html



来源:https://stackoverflow.com/questions/26037186/alter-postgresql-sequence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!