在PostgreSQL数据库中,当我尝试使用COPY函数将时间戳值插入到与该时间戳字段一起分配的表中时,我收到了错误消息:
ERROR: attribute 11 has wrong type
DETAIL: Table has type character varying, but query expects timestamp without time zone.
我将相同的时间戳vaue复制到没有分区且结果良好的另一个表。因此我想这可能是 pg_pathman
的问题DATA=# copy table_without_partition(created_time) from '/tmp/test.csv' with csv;
COPY 1
下面是测试环境和数据:
数据库:postgres 9.6.2
使用pg_pathman进行分区:
select create_range_partitions('table'::regclass,'created_time','2017-02-08 00:00:00'::timestamp,interval '1 hour',96,false );
我测试COPS功能的csv内容:2017-02-08 00:00:00
我测试的命令:
copy table(created_time) from '/tmp/test.csv' with csv;
有人会给我一些建议并帮助我吗?