【发布时间】:2020-12-28 00:26:15
【问题描述】:
我正在从tableA 中选择行并将结果行插入tableB,使用knexJS。 tableA 和 tableB 在 Redshift 数据库中具有相同的架构。
列名和类型
id - intcreated_date - timestamp without timezone
代码
knex(tableB)
.insert(function() {
this.select()
.from(tableA)
.whereRaw('id=?', ['12345']);
});
错误
这段代码遇到下面的错误
error: column \"created_date\" is of type timestamp without time zone but expression is of type character varying
如何在代码中解决这个问题?由于许多原因,更新数据库连接属性非常非常困难。
任何线索/帮助/建议将不胜感激
【问题讨论】:
标签: javascript sql postgresql amazon-redshift knex.js