且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

序列不存在 - Postgres/Spring Boot

更新时间:2022-02-18 19:50:17

这里是洞察力.

ERROR: sequence "user_id_seq" does not exist

这意味着您的序列要么不存在于数据库中用户无权访问它.

It mean your sequence either not exist in database OR the user doesn't has permission to access it.

解决方案:

  1. 通过命令ds检查数据库中的user_id_seq
  2. 向特定用户授予序列访问权限.
    GRANT ALL ON SCHEMA schema_name TO user_name 中的所有序列;
  1. Check user_id_seq in database by command ds
  2. Grant access on sequence to specific user.
    GRANT ALL ON ALL SEQUENCES IN SCHEMA schema_name TO user_name;