Skip to content

Postgres

yibinericxia edited this page Apr 3, 2025 · 1 revision

Upsert

Use the INSERT command with ON CONFLICT

INSERT INTO mytable (column1, column2)
VALUES
    (value1, value2),
    (value3, value4)
ON CONFLICT <target> <action>;

Clone this wiki locally