PostgreSQL normalize() Function

PostgreSQL normalize() converts the given string to the specified Unicode normalized form and retruns the result.

normalize() Syntax

This is the syntax of the PostgreSQL normalize() function:

normalize(str[, form])

Parameters

str

Required. a string.

form

Optional. The unicode normalized form. The Unicode Standard specifies four normalization forms: NFC, NFD, NFKC, or NFKD. The default value is NFC.

Return value

The PostgreSQL normalize() function returns a string that is the specified Unicode normalized form of the given string.

If any of the arguments are NULL, the function will return NULL.

normalize() Examples

This example shows how to use the normalize() function.

SELECT normalize(U&'\0061\0308bc', NFC);
 normalize
-----------
 äbc