Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:40:12+00:00 2026-06-17T20:40:12+00:00

Our postgres production database server has a database called crd_production which is born out

  • 0

Our postgres production database server has a database called crd_production which is born out of the template1 template database. Incidentally, on an Ubuntu 12.04 box, the default encoding of the template1 and template0 databases on initial creation of the pgcluster had a default encoding of LATIN1. I had dropped the template1 db and created it afresh with an utf-8 encoding as you can see below.

      Name      |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
----------------+----------+----------+------------+------------+-----------------------
 crd_production | deployer | UTF8     | en_US.utf8 | en_US.utf8 | 
 postgres       | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 
 template0      | postgres | LATIN1   | en_US      | en_US      | =c/postgres          +
                |          |          |            |            | postgres=CTc/postgres
 template1      | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 
(4 rows)

We eventually deployed our rails(3.2.11) app and started using the crd_production db as the primary database. There is no issue when ActiveRecord is writing/reading data but when I try to fire any sql query from psql command line on this db, the following error occurs –

crd_production=# select * from users;
ERROR:  character with byte sequence 0xe2 0x80 0x9c in encoding "UTF8" has no equivalent in encoding "LATIN1" 

crd_production=# select * from features;
ERROR:  character with byte sequence 0xe2 0x80 0x99 in encoding "UTF8" has no equivalent in encoding "LATIN1" 

What could be the problem here? Is it an issue with the client?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:40:13+00:00Added an answer on June 17, 2026 at 8:40 pm

    As guessed, the problem was with the client_encoding on the database.

    crd_production=# show client_encoding;
     client_encoding 
    -----------------
     LATIN1
    (1 row)
    

    To change the client encoding to UTF-8, you need to do this

    crd_production=#  SET client_encoding = 'UTF8';
    SET
    

    Check again

    crd_production=# show client_encoding;
     client_encoding 
    -----------------
     UTF8
    (1 row)
    

    Things work fine now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of our Postgres tables, called rep_event, has a timestamp column that indicates when
Occasionally in our lab, our postgres 8.3 database will get orphaned from the pid
Our company has a share point document server where the UNC looks something like
One of our production apps has been on Amazon RDS (MySql) for a few
We use Postgres as database for our project and found that streaming replication fit
Our postgres data folder was installed on a drive with very limited space. I'm
We're trying to add a unique constraint to our postgres table in a way
In our project we need to import the csv file to postgres. There are
In our application, we use hibernate + postgres for persistence. Recently, executing one query
We like our production environment with a restricted/unchangable schema -- the development side can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.