Background: I am using PostgreSQL 11 on CentOS. I have a database having UTF-8 encoding, in specific tables I have some Latin characters as follows [ÄéÒçòý]
Objective: I want to replace those with standard English characters for that I am trying to use the following query to list down those specific characters but getting all characters set :
SELECT name_0 from public.gadm36_0_iso2_iso3 where name_0 ~ '[[:alpha:]]';
I am searching on my side and referring to some posts as well.
Any help/any suggestions would be great !!!
2
Answers
Perhaps you are looking for
unaccent
:You can use regular expressions for this
SELECT 'ÄéÒçòý' ~* 'A[A-Z0-9]*Z';
The output should be false for the above SQL statement. So use this in your where clause.