JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

Insert ON CONFLICT parsed failed when composite primary multi columns

Open leotu opened this issue 3 years ago • 1 comments

Ref: #1630

Failed when composite primary keys (id_1+id_2) --> "ON CONFLICT (id_1, id_2)"

INSERT into test_data (id_1, id_2, my_string_1, my_string_2)
VALUES ('id_1_A', 'id_2_A', 'my_string_1-new', 'my_string_2-new')
ON CONFLICT (id_1, id_2) DO UPDATE 
SET my_string_1 = 'my_string_1-update', my_string_2 = 'my_string_2-update';

Screenshot: 截圖 2022-09-16 11 46 10

DB tools validation successfully:

(1) Left is schema, right is sample data: 截圖 2022-09-16 11 44 40

(2) Executed successfully: 截圖 2022-09-16 11 45 23

(3) Update sample data: 截圖 2022-09-16 11 45 44

leotu avatar Sep 16 '22 03:09 leotu

Thats right. This is not yet supported. JsqlParser only supports on conflict without an id list.

wumpz avatar Sep 20 '22 17:09 wumpz

Duplicate #955

manticore-projects avatar Nov 22 '22 00:11 manticore-projects

Please can someone have a look at the PostgreSQL Documentation and explain to me, where exactly it allows multiple columns?!

manticore-projects avatar Mar 07 '23 01:03 manticore-projects