¿Cómo convertir json array a text array?
Esta solución alternativa no funciona
CREATE FUNCTION json_array_castext(json) RETURNS text[] AS $f$
SELECT array_agg(x::text) FROM json_array_elements($1) t(x);
$f$ LANGUAGE sql IMMUTABLE;
-- Problem:
SELECT 'hello'='hello'; -- true...
SELECT (json_array_castext('["hello","world"]'))[1] = 'hello'; -- false!
Entonces, ¿cómo obtener una matriz real de texto?
PD: con el supuesto "ciudadano de primera clase" JSONb, el mismo problema.
Editar: después de @OtoShavadze buena respuesta (¡el comentario resuelto!), Unmanifiesto para desarrolladores de PostgreSQL: Por quéx::text
no es un elenco? (usando la página 9.5.6) y ¿por qué no genera una advertencia o un error?