Postgres 创建自增变量作为 id

代码:

CREATE TABLE fruits(
   id SERIAL PRIMARY KEY,
   name VARCHAR NOT NULL
);

数据类型 serial 的取值范围:

1 ~ 2,147,483,647

https://www.postgresqltutorial.com/postgresql-serial/

发布了188 篇原创文章 · 获赞 88 · 访问量 58万+

猜你喜欢

转载自blog.csdn.net/henryhu712/article/details/104088196