Мне удалось найти ответ на мой вопрос, спасибо @Andyk
WITH errors AS
(SELECT importable_id ,
importable_type,
created_at ,
substring(lower(replace_operation)
FROM 'code:(.+?)title') code_1 ,
split_part(replace_operation, 'code', 2) AS code_2 ,
split_part(replace_operation, 'title', 2) AS sec_part ,
split_part(split_part(replace_operation, 'title', 2), ':', 2) error_1 ,
split_part(replace_operation, 'title', 3) AS third_part ,
split_part(split_part(replace_operation, 'title', 3), ':', 2) error_2 ,
split_part(replace_operation, 'title', 4) AS f_part ,
split_part(split_part(replace_operation, 'title', 4), ':', 2) error_3 ,
split_part(replace_operation, 'title', 5) AS f_part ,
split_part(split_part(replace_operation, 'title', 5), ':', 2) error_4
FROM
( SELECT import_id ,
importable_id ,
i.importable_type ,
operation_errors AS replace_operation,
i.created_at
FROM import_results ir
JOIN imports i ON ir.import_id = i.id
WHERE operation_errors IS NOT NULL
AND i.created_at >= date_trunc('month', CURRENT_DATE :: date)) a
WHERE importable_type = 'Company')
SELECT importable_id,
created_at::date ,
code_1 ,
error_1 ,
error_2 ,
error_3 ,
error_4
FROM errors