On 3/15/19 12:59 PM, Pavel Stehule wrote: > for this proposal "char" != byte > > result[n] = substring(str FROM n FOR 1)
I think that's what string_to_array(..., null) already does:
sure. My proposal is +/- just reduction about null parameter.
SHOW server_encoding; server_encoding UTF8
WITH t0(s) AS (SELECT text 'verlorn ist daz slüzzelîn'), t1(a) AS (SELECT string_to_array(s, null) FROM t0) SELECT char_length(s), octet_length(convert_to(s, 'UTF8')), array_length(a,1), a FROM t0, t1;