Swapping UTF8 for SQL_ASCII PgAdmin

0

Good afternoon!

I need to know if it is possible for me to change my database's enconding from utf8 to SQL_ASCII, without deleting and re-creating the database! The problem that is happening is that my bank is set with Unicode UTF-8 and the site's Charset is with ISO-8859-1 so the cararacters are thus " ".

    
asked by anonymous 06.09.2018 / 15:38

1 answer

0

To change the encoding of your database:

  • Create a new database with different encoding and name
    • ex: new_bank (ISO-8859-1)
  • Create a dump of your current database
  • Restore the dump to the new bank you created in step 1
  • Test if your application runs correctly with the new database
  • Rename the old database
    • ex: application_bank (UTF-8) for old_application_bank (UTF-8)
  • Rename the new database with the old bank name
    • ex: new_bank (ISO-8859-1) for application_bank (ISO-8859-1)
  • Test the application again
  • In an emergency, just remove the new bank and rename the old one

    ex: old_application_bank (UTF-8) for application_bank (UTF-8)

        
    08.09.2018 / 04:08