PG库原设计是可以自增的, 但不知操作了什么不能自增了,参考如下文章
https://www.cnblogs.com/alianbog/p/5654604.html

没有修修复数据库,做一个临时处理办法
 if ($this->db->driverName == 'pgsql' ){
            $sql = 'select  nextval(\'lw_topos_topoid_seq\')';
            $next = \Yii::$app->db->createCommand($sql)->queryOne();
            if ($next) $clone->topoid = $next['nextval'];
        }
或
select setval(自增表(\d 可看到), 值);
 
                    
                 
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号