Re: Cleaning up array_in()

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Cleaning up array_in()
Дата
Msg-id CACJufxEv1GQ600VvTesx-E3Xvy87ZguqAjjstcNu8nPvVSmeHQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Cleaning up array_in()  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: Cleaning up array_in()  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-hackers
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.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Следующее
От: bt23nguyent
Дата:
Сообщение: Re: pg_logical_emit_message() misses a XLogFlush()