Created
June 13, 2016 09:07
-
-
Save leemour/08f738b7c83a46d9333f18f512df6c9c to your computer and use it in GitHub Desktop.
Postgres replace regexp character in a field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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