Re: Support logical replication of DDLs

Поиск
Список
Период
Сортировка
От Zheng Li
Тема Re: Support logical replication of DDLs
Дата
Msg-id CAAD30UJw=4s-BezskPH6XieigAVBdsO9dCGQddzwC7z_7MxUaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support logical replication of DDLs  (li jie <ggysxcq@gmail.com>)
Список pgsql-hackers
> 2. ALTER TABLE (inherits)
> case:
> ```
> CREATE TABLE gtest30 (
> a int,
> b int GENERATED ALWAYS AS (a * 2) STORED
> );
> CREATE TABLE gtest30_1 () INHERITS (gtest30);
> ALTER TABLE gtest30 ALTER COLUMN b DROP EXPRESSION;
> ```
> After this case is executed in the publication, the following error occurs in the subscription :
>
> ERROR:  column "b" of relation "gtest30" is not a stored generated column
> STATEMENT:  ALTER TABLE public.gtest30 ALTER COLUMN b DROP EXPRESSION, ALTER COLUMN b DROP EXPRESSION
>
> Obviously, the column modifications of the inherited table were also captured,
>
> and then deparse the wrong statement.
>
> I believe that such errors may also occur in other alter table subcmd scenarios where tables are inherited.

This is fixed in the attached v43 patch set. The fix is to skip the
deparse of the subcommand if the objectId of the subcommand doesn't
match the objectId of the parent/wrapper ALTER TABLE command.

Regards,
Zheng

Вложения

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

Предыдущее
От: David Zhang
Дата:
Сообщение: Re: Patch: Global Unique Index
Следующее
От: David Zhang
Дата:
Сообщение: Re: Patch: Global Unique Index