Thread: invalid byte sequence for encoding "UTF8"

invalid byte sequence for encoding "UTF8"

From
"Saravanakumar Ramasamy"
Date:

Hi All.

                Now I am using postgres 9.4.3 version. Before I am used 9.1.3 after I upgraded 9.4.3. Upgraded was successfully completed.

 

In Postgres 9.1.3

#------------------#

 

OS                          :  CentOS 5.2

Postgres Conf  :

                                client_encoding = default value

 

                                     List of databases

           Name           |  Owner   | Encoding  | Collate | Ctype |   Access privileges

--------------------------+----------+-----------+---------+-------+-----------------------

 postgres                 | postgres | SQL_ASCII | C       | C     |

 rsk                            | xxxxx       | SQL_ASCII | C       | C     |

 template0             | postgres | SQL_ASCII | C       | C     | =c/postgres + postgres=CTc/postgres

 template1             | postgres | SQL_ASCII | C       | C     | =c/postgres + postgres=CTc/postgres

 

Query

-----

rsk=# select columnname from tablename;

 

Status

=======

                Query is working file;

 

Get the export database following command

# pg_dump --host "localhost" --port "5432" --username "xxxxx" "DBnameXXX" > filenameXXX.sql

 

============================================================================================================================

 

After upgrade In Postgres 9.4.3

#--------------------------------#

Problem 1 :

===========

OS : CentOS 7.0

Postgres Conf :

                                client_encoding = default value

 

import databse using

=================

# psql template1 xxxxx

     template1=# create database DBnameXXX;

     template1=# \q

# psql DBnameXXX xxxxx

     rsk=# \i filenameXXX.sql

 

                                    List of databases

      Name       |  Owner   | Encoding  |  Collate   |   Ctype    |   Access privileges

-----------------+----------+-----------+------------+------------+-----------------------

 postgres        | postgres | SQL_ASCII | en_US.utf8 | en_US.utf8 |

 rsk                    | xxxxx      | SQL_ASCII | en_US.utf8 | en_US.utf8 |

 template0     | postgres | SQL_ASCII | en_US.utf8 | en_US.utf8 | =c/postgres  +  postgres=CTc/postgres

 template1     | postgres | SQL_ASCII | en_US.utf8 | en_US.utf8 | =c/postgres  +  postgres=CTc/postgres

 

 

rsk=# select columnname from tablename;

we are getting error like this,

                ERROR:  invalid byte sequence for encoding "UTF8": 0xd9 0x30

                ERROR:  invalid byte sequence for encoding "UTF8": 0x80

                ERROR:  invalid byte sequence for encoding "UTF8": 0xa2

                ERROR:  invalid byte sequence for encoding "UTF8": 0x98

                ERROR:  invalid byte sequence for encoding "UTF8": 0x92

 

how to sovle probleam, if any configuration chnage. please let me know

 

With Regards,

Saravanakumar Ramasamy.