LoginSignup
1
1

More than 5 years have passed since last update.

PostgreSQLのシーケンスがズレてしまった時の対応

Last updated at Posted at 2015-09-24
select setval('シーケンステーブル名',(select max(カラム名) from シーケンスの対象テーブル名));

例としては、EC-CUBE2の新着情報テーブルについて書くと次の通り

select setval('dtb_news_news_id_seq',(select max(news_id) from dtb_news));
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1