Skip to content

Instantly share code, notes, and snippets.

@mayhem
Created February 25, 2020 12:20
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 mayhem/a763f1ab87ff8da05ca8760f24b02863 to your computer and use it in GitHub Desktop.
Save mayhem/a763f1ab87ff8da05ca8760f24b02863 to your computer and use it in GitHub Desktop.
listenbrainz=# INSERT INTO listen
listenbrainz-# VALUES (1582632832, '7688DBA2-6033-47CD-8C6B-8C3617266C25', 'rob', '{}')
listenbrainz-# ON CONFLICT (listened_at, recording_msid, user_name)
listenbrainz-# DO NOTHING
listenbrainz-# RETURNING listened_at, recording_msid, user_name;
listened_at | recording_msid | user_name
-------------+--------------------------------------+-----------
1582632832 | 7688dba2-6033-47cd-8c6b-8c3617266c25 | rob
(1 row)
INSERT 0 1
listenbrainz=# INSERT INTO listen
VALUES (1582632832, '7688DBA2-6033-47CD-8C6B-8C3617266C25', 'rob', '{}')
ON CONFLICT (listened_at, recording_msid, user_name)
DO NOTHING
RETURNING listened_at, recording_msid, user_name;
listened_at | recording_msid | user_name
-------------+----------------+-----------
(0 rows)
INSERT 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment