[PostgreSQL] How to remove the lines from the enter key in

Heitor Helmer Herzog
1 min readOct 11, 2017

--

Sometimes the texts sent to the bank go with line break spacing as in the case:

Lory esplusum dois atuns e um pudim

lory espupu mucadaki medi dao

Lory esplusum dois atuns e um pudim

And this often when brought to a report gets formatted the wrong way.
To solve this problem we use regexp_replace in our query.

e.g:

select field1, field2,
regexp_replace(field3, E'[\\n\\r]+', ' ', 'g' )
from table1

Query output returns without row wrappings

--

--

Heitor Helmer Herzog
Heitor Helmer Herzog

Written by Heitor Helmer Herzog

Software developer, In love with games and the industry. Let’s code! About me: www.linkedin.com/in/heitorhherzog

Responses (1)