首页 > 解决方案 > 错误格式的数组文字:必须引入明确指定的数组维度

问题描述

我有下一个查询:

UPDATE public.user_item
    set instructions = concat('[', array_to_string(instructions::Text[], '", "')', ']')
    where instructions is not null;

它失败并出现错误:

ERROR:  malformed array literal: "["ERYTHRITOL, STEVIA LEAF EXTRACT, NATURAL FLAVORS."]"
DETAIL:  "[" must introduce explicitly-specified array dimensions.

字段“说明”的类型是文本

标签: sqlpostgresql

解决方案


推荐阅读