Skip to content

Instantly share code, notes, and snippets.

@house9
Created April 29, 2012 18:44
Show Gist options
  • Select an option

  • Save house9/2552587 to your computer and use it in GitHub Desktop.

Select an option

Save house9/2552587 to your computer and use it in GitHub Desktop.
-- changes joe.smith@gmail.com -> joe.smith@qa.com
update users set email = replace(replace(regexp_matches(email, '.*@')::varchar, '{', ''), '}', '') || 'qa.com';
-- there must be a better way to get rid of the {} chars returned by regexp_matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment