Postgresql Create Function Return Json Array Element Redshift