Does PostgreSQL have a built in option for converting multi-line text to single line?
To get row and columns from key=value;key=value;key=value string use , ; acts as newline in this case.

select unnest(string_to_array('key=value ; key2=value2', ';' )); 


returns :

column1 
 "key=value "
 " key2=value2"

select (string_to_array(a.r, '=' ))[1] as  k , (string_to_array(a.r, '=' ))[2] as v  from (select unnest(string_to_array('key=value ; key2=value2', ';' )) as r  ) as a


returns: 

k , v 
"key";"value "
" key2";"value2"


To other way around (table test has k and v colums)

select string_agg(k || '=' ||v, ';') from test


if you have table like 'conf_file', 'key', 'value' you can use group by clause in string_agg