RSS

  • YouTube
  • LinkedIn
  • Google

Creating PostgreSQL database with different encoding

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

How to create a database UTF8 in a server in LATIN1 or creating a LATIN1 database on a server into UTF8?

PostgreSQL has these things. It does not allow the creation of databases with different Encoding in a same template.
Today I tried to create a new database in UTF8 and came across the following:

This is because the locale of the S.. are in latin1 and when PostgreSQL was installed it absorbs this setting.
When I tried to install in an encoding other than the default set he complained for not being in accordance with the default template that is the template1.

To be able to create a foundation in a different encoding, it is necessary to use another template and in my case I used the template0.

The same can be done when the system locale is UTF8 and if you want to create a base in LATIN1.

I hope I helped.


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.