Re: [SQL] array_in: '{}}'::text[]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] array_in: '{}}'::text[]
Дата
Msg-id 14978.1093662341@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] array_in: '{}}'::text[]  (Joe Conway <mail@joeconway.com>)
Ответы Re: [SQL] array_in: '{}}'::text[]  (Joe Conway <mail@joeconway.com>)
Список pgsql-patches
Joe Conway <mail@joeconway.com> writes:
>       /* Make a modifiable copy of the input */
> !     string_save = (char *) palloc0(strlen(string) + 1);
>       strcpy(string_save, string);

palloc0, instead of palloc, is clearly a waste of cycles here ...

actually, why isn't this just a pstrdup?

>       /* special case for an empty array */
> !     if (strlen(str) == 2 && strncmp(str, "{}", 2) == 0)
>           return 0;

Why not just if (strcmp(str, "{}") == 0)

Looks reasonable otherwise.

            regards, tom lane

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

Предыдущее
От: "Ed L."
Дата:
Сообщение: Re: log_filename_prefix --> log_filename + strftime()
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: log_filename_prefix --> log_filename + strftime()