Is there a way fix the � problem in postgres database:

enter image description here

As you can see there are names with accents and are not displayed corretly in the database. I would like to know if there is a way to fix this without dropping the database and restoring it... ?

When I execute

SELECT CAST (userfirstname AS bytea) FROM tab WHERE id = 42;`

this is the result i get:

(1 ligne)

1 Answer 1


That character (0xEFBFBD in UTF-8) really is Unicode 0xFFFD, the “replacement character” �.

So if that's not what you want, the problem must have occurred when you inserted the data into the database. PostgreSQL does not surreptitiously modify strings, so some software most have done that before the data were put into the database.

Since the characters you would like to see are not all equal (I spot é and ç, for example), there is no automatic way to repair the damage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.