Skip to content

Instantly share code, notes, and snippets.

@samsonasik
Created January 7, 2016 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsonasik/f8cdf471b2a8f82bd2be to your computer and use it in GitHub Desktop.
Save samsonasik/f8cdf471b2a8f82bd2be to your computer and use it in GitHub Desktop.

-- CREATE EXTENSION "uuid-ossp";

--insert into album(id, artist, title) --values((select uuid_generate_v4()), 'Foo', 'Foox');

-- for example: on this case, uuid generate return: f316f033-87a8-450e-a4df-94ac6e32f87d

insert into album(id, artist, title) values('f316f033-87a8-450e-a4df-94ac6e32f87d', 'Foo', 'Foo2') ON CONFLICT(id) DO UPDATE SET title=excluded.title;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment