Stack Exchange
How can I add quote to each element in list of string
I have a postgresql sql that return a list o element stored in column : 
This is my sql : 
SELECT quote_literal(value) AS cluster_values 
FROM process_configuration pc 
WHERE pc.parameter='CLUSTER_DATA_ELEMENT';

this request give me this value : 
cluster_values
----------------------------
'Gender,ResidenceAddress'

The value that I want to get is this : a quote on each element :  'Gender','ResidenceAddress'
cluster_values
----------------------------
'Gender','ResidenceAddress'

Plz can someone help me fixing this thank you in advance 

Use regexp_replace():
SELECT regexp_replace(value, '([^,]+)', '''\1''', 'g') AS cluster_values 
FROM process_configuration pc 
WHERE pc.parameter = 'CLUSTER_DATA_ELEMENT';

       cluster_values        
-----------------------------
 'Gender','ResidenceAddress'
(1 row) 

