One - One Code All

Blog Content

postgresql 清除数据并清除自增ID

PostgreSQL   2017-05-13 11:12:06

单纯清除数据的方法
– 清除所有的记录(有外键关联的情况下)
TRUNCATE TABLE questions CASCADE;

– 清除所有的记录,并且索引号从0开始
TRUNCATE TABLE questions RESTART IDENTITY CASCADE;



上一篇:postgresql的pg_reload的使用及注意事项
下一篇:postgresql查询和自定义设置主键id序列值

The minute you think of giving up, think of the reason why you held on so long.