Re: Support logical replication of DDLs

Поиск
Список
Период
Сортировка
От Zheng Li
Тема Re: Support logical replication of DDLs
Дата
Msg-id CAAD30UKUZA3Ky77yhozPJMQCjOjAvBq4EA+Q6J0figs98GaByg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support logical replication of DDLs  (Zheng Li <zhengli10@gmail.com>)
Список pgsql-hackers
> > From the user perspective, I expect that the replicated objects are
> > created on the subscriber by the same owner as the publisher, by
> > default.
>
> OK, I agree. I think the use cases for matching the owner are likely
> more than the other way around. I can make the subscription option
> "match_ddl_owner" on by default in the next version.

> > > > Now, coming to implementation, won't it be better if we avoid sending
> > > > the owner to the subscriber unless it is changed for the replicated
> > > > command? Consider the current case of tables where we send schema only
> > > > if it is changed. This is not a direct mapping but it would be better
> > > > to avoid sending additional information and then process it on the
> > > > subscriber for each command.
> > >
> > > Right, we can do some optimization here: only send the owner for
> > > commands that create objects (CREATE TABLE/FUNCTION/INDEX etc.) Note
> > > that ALTER TABLE/OBJECT OWNER TO is replicated so we don't need to
> > > worry about owner change.
> >
> > What role will be used for executing ALTER and DROP commands on the
> > subscriber? the subscription owner?
>
> Yes, I think DROP and ALTER commands (and other non-CREATE commands)
> can be executed by the subscription owner (superuser).

Attached please find the new patch set with the following changes:
1. Changed the default value of the subscription option "match_ddl_owner" to on.
2. Changed deparser logic to only include the owner for commands that
create objects.
3. Addressed a merge conflict with a recent commit in pg_proc.dat.

Regards,
Zane

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size
Следующее
От: Andrew Dunstan
Дата:
Сообщение: buildfarm + meson