On Sun, Sep 10, 2023 at 6:00 PM Alexander Lakhin <exclusion@gmail.com> wrote:
> Case 1:
> SELECT '{1,'::integer[];
> ERROR: malformed array literal: "{1,"
> LINE 1: SELECT '{1,'::integer[];
> ^
> DETAIL: Unexpected end of input.
>
> vs
>
> ERROR: malformed array literal: "{1,"
> LINE 1: SELECT '{1,'::integer[];
> ^
>
> (no DETAIL)
>
> Case 2:
> SELECT '{{},}'::text[];
> ERROR: malformed array literal: "{{},}"
> LINE 1: SELECT '{{},}'::text[];
> ^
> DETAIL: Unexpected "}" character
>
> vs
> text
> ------
> {}
> (1 row)
>
> Case 3:
> select '{\{}'::text[];
> text
> -------
> {"{"}
> (1 row)
>
> vs
> text
> ------
> {""}
>
> Best regards,
> Alexander
hi.
Thanks for reviewing it.
> DETAIL: Unexpected end of input.
In many cases, ending errors will happen, so I consolidate it.
SELECT '{{},}'::text[];
solved by tracking current token type and previous token type.
select '{\{}'::text[];
solved by update dstendptr.
attached.