• 1-888-289-2246
  • 24x7x365 Presence

How to change PostgreSQL database encoding


To accomplish this task, we need to delete the existing database first and then re-create the same with the required encoding.

Steps:-
  1. Login to the respective PostgreSQL server
  2. su -l postgres
  3. dropdb
  4. createdb -E UNICODE -O
  5. Exit

Note :- If the database contains data, it will be lost. So, it is advisable to take the backup of the database before deletion. After the creation of the database with the required encoding, data can be restored from the backup.

]]>


Leave a Reply

Your email address will not be published. Required fields are marked *