1

In a PostgreSQL database, when I tried to make use of COPY function to insert a timestamp value into a table that partitoined with that timestamp field, I got blelow error message:

ERROR:  attribute 11 has wrong type
DETAIL:  Table has type character varying, but query expects timestamp without time zone.

I COPY the same timestamp vaue to anther table that has no partitioning and result is good. Therefor I guess this might be a problem for pg_pathman

DATA=# copy table_without_partition(created_time) from '/tmp/test.csv' with csv;
COPY 1

Below is may testing env and data:

Database: postgres 9.6.2

Partition with pg_pathman:

select create_range_partitions('table'::regclass,'created_time','2017-02-08 00:00:00'::timestamp,interval '1 hour',96,false );

The csv content I test for COPY function: 2017-02-08 00:00:00

The command I test:

 copy table(created_time) from '/tmp/test.csv' with csv;

Would someone give me some advise and help me out?

  • Problem resolved! For more details, please refer to https://github.com/postgrespro/pg_pathman/issues/87#ref-commit-9a354ad – PatrickYung Apr 24 '17 at 05:13

0 Answers0