I have a column in my table block_sizes(varchar) that looks like:
12,23,
234,23,
78,64,28,
i.e., comma-separated integer values (and the included trailing comma). I would like to convert these each to an array and store in another column. However, I haven't been able to get this to work. I have tried things like:
array[rtrim(block_sizes,',')]
'''' || '{' || rtrim(block_sizes,',') || '}' || ''''::int[]
'{' || rtrim(block_sizes,',') || '}'
as expressions in an update to the new column (declared as int[]). However, it seems as if the result of the rtrim is treated differently than the same expression entered directly. Can someone enlighten me as to how to make this conversion?
Thanks,
Sean