Use Slony-I to switch encoding online
What do you do when you have to switch encoding in PostgreSQL and at the same time have your database online for users?
1) Setup a new Slony cluster
http://slony.info/documentation/2.1/tutorial.html#FIRSTDB
2) Add your new empty server with UTF8 encoding storage
ALTER USER <slon-user> SET client_encoding TO 'LATIN1';
3) Start replicating and wait for all data to be transferred
http://slony.info/documentation/2.1/startingstopping.html
4) Switch master
Written by William Tisäter
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#