Re: [PATCH] pg_convert improvement

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: [PATCH] pg_convert improvement
Дата
Msg-id 20231201215039.GA1668447@nathanxps13
обсуждение исходный текст
Ответ на Re: [PATCH] pg_convert improvement  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
Ответы Re: [PATCH] pg_convert improvement  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Mon, Nov 27, 2023 at 08:11:06AM +0100, Drouvot, Bertrand wrote:
> +        PG_RETURN_BYTEA_P(string);

I looked around to see whether there was some sort of project policy about
returning arguments without copying them, but the only strict rule I see is
to avoid scribbling on argument data without first copying it.  However, I
do see functions that return unmodified arguments both with and without
copying.  For example, unaccent_dict() is careful to copy the argument
before returning it:

    PG_RETURN_TEXT_P(PG_GETARG_TEXT_P_COPY(strArg));

But replace_text() is not:

    /* Return unmodified source string if empty source or pattern */
    if (src_text_len < 1 || from_sub_text_len < 1)
    {
        PG_RETURN_TEXT_P(src_text);
    }

I don't have any specific concerns about doing this, though.  Otherwise,
the patch looks pretty good to me, so I will plan on committing it shortly.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: "Tristan Partin"
Дата:
Сообщение: Re: Improving asan/ubsan support
Следующее
От: "Tristan Partin"
Дата:
Сообщение: Re: pgsql: meson: docs: Add {html,man} targets, rename install-doc-*