Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

Поиск
Список
Период
Сортировка
От Philip Alger
Тема Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Дата
Msg-id CAPXBC8JqaqFb7cwPibJkdORDPSSYBuxBbthgfqWPK2Jr=_8omQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement  (Josef Šimánek <retro@ballgag.cz>)
Ответы Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Список pgsql-hackers
Hello,

 
> I think it’s better to pfree(res).

Would you mind to share why pfree is needed? I tried to trace this
with Valgrind, but even pfree(res) was present or not, there was no
leak detected and both compiles without additional warnings. Wouldn't
be res "trashed" at the end of the function (after next line) anyway?

The wrapper function string_to_text, which is a wrapper for cstring_to_text, includes pfree. 

see ruleutils.c

static text *
string_to_text(char *str)
{
     text   *result;

     result = cstring_to_text(str);
     pfree(str);
     return result;
}


--
Best, 
Phil Alger

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