RE: Support logical replication of DDLs

Поиск
Список
Период
Сортировка
От houzj.fnst@fujitsu.com
Тема RE: Support logical replication of DDLs
Дата
Msg-id OS0PR01MB57160412FC99012E54735E9194AC9@OS0PR01MB5716.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Support logical replication of DDLs  (Ajin Cherian <itsajin@gmail.com>)
Список pgsql-hackers
On Thursday, February 23, 2023 7:42 PM Ajin Cherian <itsajin@gmail.com> wrote:
> 
> On Tue, Feb 7, 2023 at 11:05 PM vignesh C <vignesh21@gmail.com> wrote:
> >
> > On Mon, 6 Feb 2023 at 17:02, vignesh C <vignesh21@gmail.com> wrote:
> > >
> > I found few issues while testing:
> > Issue 7: no owned sequence found
> > Steps to reproduce:
> > CREATE TABLE itest13 (a int);
> > ALTER TABLE itest13 ADD COLUMN b int GENERATED BY DEFAULT AS
> IDENTITY;
> >
> 
> I've fixed this issue. The reason for the failure was because, for implicitly
> generated sequences, the sequence relation is stored in
> coldef->identitysequence and has to be fetched from there.
> The fix is in patch-0002

In the past patch set, we introduced a new SCT_xx command some new functions to
collect CREATE/ALTER PUBLICATION command. After rethinking, we can try to use
the existing collected parse tree and objectaddress to deparse the publication
commands instead. And here is the new version patch which attempts to do it this
way.

For CREATE PUBLICATION command, we can get all the table and schema information
from pg_publication_rel/namespace catalog and build the command. For ALTER
PUBLICATION ADD/DROP/SET command, because we collect each added and dropped
object separately, so we need to convert the original command to serval single
ADD or DROP commands like the following:

--
ALTER PUBLICATION pub1 ADD table t1, t2, t3; 

will be converted to:

ALTER PUBLICATION pub1 ADD table t1;
ALTER PUBLICATION pub1 ADD table t2;
ALTER PUBLICATION pub1 ADD table t3;
--

0003,0006 and 0008 patch are modified in this version.

Best regards,
Hou zj




Вложения

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

Предыдущее
От: "Takamichi Osumi (Fujitsu)"
Дата:
Сообщение: RE: Rework LogicalOutputPluginWriterUpdateProgress
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: We shouldn't signal process groups with SIGQUIT