Unable to insert-as-select row to the table when primary key exist on destination table #8949
Labels
enhancement
Enhancement that doesn't fit into a more specific feature label. Try avoid using this
feature: ux
Milestone
CrateDB version: 3.3.5
Problem description:
Insert-as-select silently rejected when PK exists on the dest table.
Ref to #8312 - Please, add parameter to raise error - maybe at session level, maybe at server level, maybe in syntax, maybe something else.
At now insert-as-select not usable, I have to re-check all results.
I can help with PR if need.
Steps to reproduce:
create table test1 (x string, primary key (x));
>> Table TEST1 created.
create table test2 (x string, primary key (x));
>> Table TEST2 created.
create table test3 (x string);
>> Table TEST3 created.
insert into test1 (x) values ('a');
>> 1 row inserted.
insert into test2 (x) select x from test1 where x = 'a';
>> 0 rows inserted.
No data copied to dest table. No errors received ;(insert into test2 (x) select 'a' from test1 where x = 'a';
Same then previous, but successful when value is constant>> 1 row inserted.
insert into test3 (x) select x from test1 where x = 'a';
>> 1 row inserted.
No PK on dest table - request successfulThe text was updated successfully, but these errors were encountered: