网上搜了很多资料,问题出现在一个地方,就是字段问题(integer),改为serial即可。

但是必须重新建表 ,如果不想重新建表,参考(本人没尝试过):https://stackoverflow.com/questions/23578427/changing-primary-key-int-type-to-serial

从pgsql中导出sql文件发现是这样:

pgsql   psycopg2.errors.NotNullViolation: null value in column "id" violates not-null constraint错误解决

 解决方案:

 重新建表(如果出现pk_test_a_id已经存在,改一下即可)

 create table info_xxx
(
    id serial,
        ........ , 
    constraint pk_test_a_id primary key(id)
);

 

pgsql   psycopg2.errors.NotNullViolation: null value in column "id" violates not-null constraint错误解决

 

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
  • 2022-01-20
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案