F
F
FasterTans2020-11-26 20:14:43
PostgreSQL
FasterTans, 2020-11-26 20:14:43

Whether it is possible to make ON CONFLICT without unique on the field?

INSERT INTO distributors (did, dname)
    VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc')
    ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname;

Onconflict only works if the table has a unique on the columns that are being transferred. Is it possible to make such a request without setting the unique on the fields?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-11-26
@galaxy

What then is the conflict?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question