Skip to content

Instantly share code, notes, and snippets.

@hvrauhal
Last active July 4, 2016 12:02
Show Gist options
  • Save hvrauhal/91a46bdd7433781286f1f81f4d79b31f to your computer and use it in GitHub Desktop.
Save hvrauhal/91a46bdd7433781286f1f81f4d79b31f to your computer and use it in GitHub Desktop.
drop table if exists gist_test;
create table gist_test (
bar text,
foo text,
constraint gist_test_bar_unique unique (bar),
constraint gist_test_foo_gist_unique exclude using gist (foo with =)
);
insert into gist_test (bar, foo) values ('bar', 'foo');
insert into gist_test (bar, foo) values ('baz', 'foo')
on conflict on constraint gist_test_bar_unique
do nothing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment