INSERT ... ON CONFLICT DO SELECT lets the RETURNING clause return existing rows that conflict with an insert, optionally locking them with FOR UPDATE/FOR SHARE. This simplifies the "get or create" pattern.
INSERT ... ON CONFLICT DO SELECT
RETURNING
FOR UPDATE
FOR SHARE