TP5.1 pgsql数据库批量插入使用insertAll时,sql原码如下:
insert into test (age) select '1' union all select '1'
age int类型
报错如下:
ERROR: column "age" is of type integer but expression is of type text
数据报错类型错误,pgsql union all后的数据库插入需要和前面字段同类型,不知道各位有没有什么好的解决办法
如果是insert into (age) values ('1'),('1')这样是不区分类型,但是想直接可以使用insertAll