NORMALIZE
Example
Section titled “Example”SELECT NORMALIZE('Ábc');Output
Section titled “Output”'Abc'Explanation
Section titled “Explanation”The NORMALIZE() function is used to transform a text string into a form that can be compared on an equivalent basis. In the provided example, the NORMALIZE function transforms the ‘Á’ character into ‘A’.
Example
Section titled “Example”CREATE EXTENSION IF NOT EXISTS isn;CREATE TABLE test (col VARCHAR(10));INSERT INTO test VALUES ('1234'), ('5678'), ('9123');SELECT col, NORMALIZE(col) as normalized_col FROM test;Output
Section titled “Output” col | normalized_col------+---------------1234 | 12345678 | 56789123 | 9123Explanation
Section titled “Explanation”The NORMALIZE function in PostgreSQL transforms a string into its normalized form, which means it rearranges accented characters and similar entities into a standard form. In this example, the values in col are already normalized, hence the normalized output is equivalent to the input.