select string_agg(distinct 'pre' || user.col, 'post')
As the above will deny the use of an index in the distinct
aggregation take the 'pre'
out
select 'pre' || string_agg(distinct user.col, 'postpre')
select string_agg(distinct 'pre' || user.col, 'post')
As the above will deny the use of an index in the distinct
aggregation take the 'pre'
out
select 'pre' || string_agg(distinct user.col, 'postpre')