Re: Support logical replication of DDLs

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Support logical replication of DDLs
Дата
Msg-id CAA4eK1KixJkodJOgLMuW0wxixsTnrNR3MAyxD7_oPyv8B+YgUw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support logical replication of DDLs  (shveta malik <shveta.malik@gmail.com>)
Список pgsql-hackers
On Thu, Apr 20, 2023 at 6:09 PM shveta malik <shveta.malik@gmail.com> wrote:
>
>
> Few more comments, mainly for event_trigger.c  in the patch dated April17:
>
> 1)EventTriggerCommonSetup()
> +    pub_funcoid = LookupFuncName(pubfuncname, 0, NULL, true);
>
> This is the code where we have special handling for ddl-triggers. Here
> we are passing 'missing_ok' as true, so shouldn't we check pub_funcoid
> against 'InvalidOid' ?
>

I think so. However, I think this shouldn't be part of the first patch
as the first patch is only about deparsing. We should move this to DDL
publication patch or maybe a separate patch altogether. Another thing
is I feel it is better if this functionality is part of
filter_event_trigger().

>
> 2) EventTriggerTableInitWriteEnd()
>
> + if (stmt->objtype == OBJECT_TABLE)
> + {
> +    parent = currentEventTriggerState->currentCommand->parent;
> +    pfree(currentEventTriggerState->currentCommand);
> +    currentEventTriggerState->currentCommand = parent;
> + }
> + else
> + {
> +    MemoryContext oldcxt;
> +    oldcxt = MemoryContextSwitchTo(currentEventTriggerState->cxt);
> +    currentEventTriggerState->currentCommand->d.simple.address = address;
> +    currentEventTriggerState->commandList =
> +         lappend(currentEventTriggerState->commandList,
> +     currentEventTriggerState->currentCommand);
> +
> +     MemoryContextSwitchTo(oldcxt);
> + }
> +}
>
> It will be good to add some comments in the 'else' part. It is not
> very much clear what exactly we are doing here and for which scenario.
>

Yeah, that would be better. I feel the event trigger related changes
should be moved to a separate patch in itself.

--
With Regards,
Amit Kapila.



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

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: Fix typos and inconsistencies for v16
Следующее
От: Jelte Fennema
Дата:
Сообщение: Re: Reorder connection markers in libpq TAP tests