У меня есть таблица в Postgres со следующим столбцом:
col1
The study was terminated early by the sponsor on 13 January 2014 due to a decision to modify the drug development plan.
Due to positive preliminary results from other palifermin studies.
Asset terminated by PIB
Inconsistent training status of sniffer dogs
This study was terminated early due to poor recruitment
The study was terminated due to lack of recruitment.
The scientific director decided to terminate: low priority study with slow accrual
See Termination Reason in Detailed Description.
Investigator moved to new institution
This study was terminated for administrative reasons
The app was not completed in time to conduct a clinical trial on it within the funding grant's award period
В строке есть начальные и запаздывающие пробелы и между ними '\ n' или '\ t'. Я попробовал следующие запросы, но, похоже, ничего не получается.
select btrim(col1, '\s') from table;
update table
SET col1 = upper(substring(REGEXP_REPLACE(col1, '(\s+)', '') from 1 for 1)) || lower(substring(REGEXP_REPLACE(why_stopped, '(\s+)', '') from 2));
update table
set col1= regexp_replace(col1, E'[\\n\\r\\f\\u000B\\u0085\\u2028\\u2029]+', ' ', 'g' );
select distinct replace( replace( replace( col1, E'\n', '\n' ), E'\t', '\t' ), E'\r', '\r' )
from table;
Любое предложение будет очень полезно здесь.