I have a PostgreSQL 10 database that uses WIN1252 encoding.
One of my columns has values that cause conversion errors when running a select from pgAdmin 4:
SELECT myfield FROM mydb.myschema."MYTABLE"
ERROR: character with byte sequence 0x9d in encoding "WIN1252" has no equivalent in encoding "UTF8" SQL state: 22P05
Setting the client encoding to WIN1252 in pgAdmin 4 causes it to drop the connection to the database (I remember reading somewhere that pgAdmin 4 has issues with setting the client encoding, but track down the link).
Using psql and setting the client encoding to WIN1252, selecting one of the offending features:
SELECT myfield FROM mydb.myschema."MYTABLE" WHERE oid = 12345
â€œA sample comment
Looking at the data that was originally imported into the DB, it appears that “curly quotes” were incorrectly imported.
Is there a way to remove these characters from the column - either replacing them with regular quotation marks, or simply deleting them?