Skip to content

Instantly share code, notes, and snippets.

@leemour
Created June 13, 2016 09:07
Show Gist options
  • Save leemour/08f738b7c83a46d9333f18f512df6c9c to your computer and use it in GitHub Desktop.
Save leemour/08f738b7c83a46d9333f18f512df6c9c to your computer and use it in GitHub Desktop.
Postgres replace regexp character in a field
ActiveRecord::Base.connection.execute("
UPDATE adverts SET tel = regexp_replace(tel, '\\+78', '7');
")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment