Last active
May 11, 2017 14:41
-
-
Save siedovolosyi/95433104dae9c678b3d99e881db50da9 to your computer and use it in GitHub Desktop.
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
| DO $$DECLARE tables CURSOR FOR SELECT table_name FROM information_schema.columns WHERE column_name='country'; newName TEXT = 'al';BEGIN FOR broken_table IN tables LOOP EXECUTE 'UPDATE ' || broken_table.table_name || ' SET country = ''' || newName || ''''; END LOOP;END $$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment