Re: [PATCH] Remove make_temptable_name_n()

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: [PATCH] Remove make_temptable_name_n()
Дата
Msg-id aPffbfbXfHsr776w@nathan
обсуждение исходный текст
Ответ на Re: [PATCH] Remove make_temptable_name_n()  (Aleksander Alekseev <aleksander@tigerdata.com>)
Ответы Re: [PATCH] Remove make_temptable_name_n()
Список pgsql-hackers
On Tue, Oct 21, 2025 at 03:36:46PM +0300, Aleksander Alekseev wrote:
> +    {
> +        char       *nsp = get_namespace_name(RelationGetNamespace(tempRel));
> +        char       *temprelname = RelationGetRelationName(tempRel);
> +        char       *diffrelname = psprintf("%s_%d", temprelname, 2);

I assume the intent of the extra set of curly brackets is to keep the
declarations of these variables close to where they are used.  In this
case, the top of the function is only a few lines up, so IMHO we should
declare them there and save a level of indentation.

> +        pfree(diffrelname);
> +        if (nsp)
> +            pfree(nsp);

Any reason to be so careful about freeing these?  We ordinarily let the
memory context take care of freeing, and refresh_by_match_merge() looks no
different.

-- 
nathan



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