Is there some function to normalize name string:
select normalize('R.C. Bray')
'R. C. Bray'
Or the opposite direction?
The simple replace('. ', '.')
or replace('.', '. ')
is wrong and may be effect another data.
normalizationpostgresql
Is there some function to normalize name string:
select normalize('R.C. Bray')
'R. C. Bray'
Or the opposite direction?
The simple replace('. ', '.')
or replace('.', '. ')
is wrong and may be effect another data.
Best Answer
regexp_replace
should be enough:This replaces a single upper case letter followed by a
.
directly followed by a "word character" by inserting a space between the dot and the character. It leaves dots that have a whitespace after them untouched.