Bug 3745

Summary: COPY BINARY doesn't support copy without auto-increment column
Product: SQL Reporter: 357416268
Component: allAssignee: SQL devs <bugs-sql>
Status: NEW ---    
Severity: enhancement    
Priority: Normal    
Version: -- development   
Hardware: x86 (i?86)   
OS: Linux   

Description 357416268 2015-06-22 18:35:47 CEST
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Build Identifier: 

If I COPY BINARY INTO a table which has a serial type primary key,
I can not use COPY BINARY INTO command directly to this table,
I must create a helper table without auto increment primary key, COPY BINARY INTO the helper table and then insert into the large table from the helper table.
but usually the last step is very time consuming.

Reproducible: Always

Steps to Reproduce:
1.create table uniquecatalogg(targetid int, ra_avg double, decl_avg double, flux_ref double, zone smallint, x double, y double, z double);
2.create sequence "unique_seq" as int;
3.create table uniquecatalog(id  int PRIMARY KEY DEFAULT NEXT VALUE FOR "unique_seq"
, targetid int, ra_avg double, decl_avg double, flux_ref double, datapoints int, one smallint, x double, y double, z double, INACTIVE BOOLEAN);
Actual Results:  
when I COPY BINARY 78GB binary data into monetdb, loading only takes 523.231 second, 
while the last INSERT INTO takes 576.388 second.

Expected Results:  
COPY BINARY INTO table (col1, col2, col3) FROM file1, file2, file3;
if the table has a auto increment column, the column grows in the background like what it does in
INSERT INTO command.