PostgreSQL, change encoding preserving data

From: info(at)denisgottardello(dot)it
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: PostgreSQL, change encoding preserving data
Date: 2023-02-23 13:00:46
Message-ID: RQJATA$1E1680D647802A67AD54279BC45B25E6@denisgottardello.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Hi, my database is setup with encoding= win1252. In order to go to utf8 I run the followed query:

update pg_database set encoding= pg_char_to_encoding('utf8') where datname= 'Handyman'

The problem is that, the database has already got data with special characters such as "àòèé". After having executed the query to change the encoding to utf8, I can't read the special caracters.
Is there a way to change the encoding and to migtrate the data?
Best regards.

+39.347.4070897

http://www.labcsp.com

http://www.denisgottardello.it

GMT+1

Skype: mrdebug

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2023-02-23 13:18:54 Re: PostgreSQL, change encoding preserving data
Previous Message Tom Lane 2023-02-22 21:03:31 Re: Alter default privileges is not working for roles