Created
December 2, 2017 02:40
-
-
Save ugnb/294c3403a312129957902a5f6fdf201b to your computer and use it in GitHub Desktop.
Postgresql: Update row with insertion values in case of conflict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO table1 | |
(id, column1, column2, column3) | |
VALUES | |
(:id, :column1, :column2, :column3) | |
ON CONFLICT (id) DO UPDATE | |
SET | |
column1 = EXCLUDED.column1, | |
column2 = EXCLUDED.column2, | |
column3 = EXCLUDED.column3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment