Created
October 28, 2016 05:50
-
-
Save Tyralion/2da41661a8326175c7c13ae001c5fd0a to your computer and use it in GitHub Desktop.
inser or update
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
create table test (a varchar(255), b varchar(255), c integer); | |
create unique index idx_test_a_b on test (a, b); | |
insert into test values ('a', 'foo', 1); | |
select * from test; | |
insert into test values ('a', 'foo', 1) on conflict (a, b) do update set a = 'c'; | |
select * from test; | |
drop table test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment