Issue with COPY command
Hello to everyone,
I found a very interesting bug with COPY command. Sadly I had to pay for this with some real production data but nevertheless.
That is the case. I have a table with some fields like this
create table test(
a int,
b int,
c int,
d int
);
And I'm using COPY command to load some big batches with data. So I have batch like this
1|2|3
4|5|6
7|8|9
So this batch can be loaded into vertica using following COPY command - COPY test (a,b,c) FROM STDIN DELIMITER '|' and everything works fine.
Problem appears when you have more columns in COPY command than in the batch. So let's say I have the same batch but COPY command was changed to this (we added new column for this table) - COPY test (a,b,c,d) FROM STDIN DELIMITER '|'. In this case data just goes to nowhere but COPY command executes without errors.
Similar case in Postgres 9.2.2 works correctly and I receive an error - ERROR: missing data for column "d"
I found a very interesting bug with COPY command. Sadly I had to pay for this with some real production data but nevertheless.
That is the case. I have a table with some fields like this
create table test(
a int,
b int,
c int,
d int
);
And I'm using COPY command to load some big batches with data. So I have batch like this
1|2|3
4|5|6
7|8|9
So this batch can be loaded into vertica using following COPY command - COPY test (a,b,c) FROM STDIN DELIMITER '|' and everything works fine.
Problem appears when you have more columns in COPY command than in the batch. So let's say I have the same batch but COPY command was changed to this (we added new column for this table) - COPY test (a,b,c,d) FROM STDIN DELIMITER '|'. In this case data just goes to nowhere but COPY command executes without errors.
Similar case in Postgres 9.2.2 works correctly and I receive an error - ERROR: missing data for column "d"
0
Comments
Thanks a lot for your reply.
I used ABORT ON ERROR directive before but totally forgot about it in this case. And I found my data in CopyErrorLogs folder.
But it confuses me a little that by default there is no notification about that. So it is not easy to notice that you are missing some data. Am I missing anything else?
Regards,
Sergey.