Re: Support logical replication of DDLs

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Ajin Cherian <itsajin@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, "wangw.fnst@fujitsu.com" <wangw.fnst@fujitsu.com>, Runqi Tian <runqidev@gmail.com>, Peter Smith <smithpb2250@gmail.com>, li jie <ggysxcq@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Amit Kapila <amit.kapila16@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Japin Li <japinli@hotmail.com>, rajesh singarapu <rajesh.rs0541@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Zheng Li <zhengli10@gmail.com>
Date: 2023-03-26T12:38:37Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add a run_as_owner option to subscriptions.

  2. Refactor pgoutput_change().

  3. Print the correct aliases for DML target tables in ruleutils.

  4. Fix object identity string for transforms

  5. Add grantable MAINTAIN privilege and pg_maintain role.

  6. Get rid of recursion-marker values in enum AlterTableType

  7. Release cache tuple when no longer needed

  8. Empty search_path in logical replication apply worker and walsender.

  9. Refactor format_type APIs to be more modular

  10. Use wrappers of PG_DETOAST_DATUM_PACKED() more.

On Thu, 23 Mar 2023 at 09:22, Ajin Cherian <itsajin@gmail.com> wrote:
>
> On Mon, Mar 20, 2023 at 8:17 PM houzj.fnst@fujitsu.com
> <houzj.fnst@fujitsu.com> wrote:
> >
> > Attach the new patch set which addressed above comments.
> > 0002,0003,0004 patch has been updated in this version.
> >
> > Best Regards,
> > Hou zj
>
> Attached a patch-set which adds support for ONLY token in ALTER TABLE..
> Changes are in patches 0003 and 0004.

Few comments:
1) This file should not be included:
 typedef struct
diff --git a/src/test/modules/test_ddl_deparse_regress/regression.diffs
b/src/test/modules/test_ddl_deparse_regress/regression.diffs
deleted file mode 100644
index 3be15de..0000000
--- a/src/test/modules/test_ddl_deparse_regress/regression.diffs
+++ /dev/null
@@ -1,847 +0,0 @@
-diff -U3 /home/ajin/postgresql/postgres/postgres2/postgres/src/test/modules/test_ddl_deparse_regress/expected/create_table.out
/home/ajin/postgresql/postgres/postgres2/postgres/src/test/modules/test_ddl_deparse_regress/results/create_table.out
---- /home/ajin/postgresql/postgres/postgres2/postgres/src/test/modules/test_ddl_deparse_regress/expected/create_table.out
     2023-03-22 23:08:34.915184709 -0400
-+++ /home/ajin/postgresql/postgres/postgres2/postgres/src/test/modules/test_ddl_deparse_regress/results/create_table.out
      2023-03-22 23:09:46.810424685 -0400

2) The patch does not apply neatly:
git am v82-0004-Introduce-the-test_ddl_deparse_regress-test-modu.patch
Applying: Introduce the test_ddl_deparse_regress test module.
.git/rebase-apply/patch:2489: trailing whitespace.
 NOTICE:  re-formed command: CREATE  TABLE  public.ctlt1_like (a
pg_catalog.text STORAGE main  COLLATE pg_catalog."default"   , b
pg_catalog.text STORAGE external  COLLATE pg_catalog."default"   ,
CONSTRAINT ctlt1_a_check CHECK ((pg_catalog.length(a)
OPERATOR(pg_catalog.>) 2)), CONSTRAINT ctlt1_like_pkey PRIMARY KEY
(a))
.git/rebase-apply/patch:2502: trailing whitespace.
 NOTICE:  re-formed command: ALTER TABLE public.test_alter_type ALTER
COLUMN quantity SET DATA TYPE pg_catalog.float4
.git/rebase-apply/patch:2511: trailing whitespace.
-NOTICE:  re-formed command: CREATE  TABLE
public.test_alter_set_default (id pg_catalog.int4 STORAGE plain     ,
name pg_catalog."varchar" STORAGE extended  COLLATE
pg_catalog."default"   , description pg_catalog.text STORAGE extended
COLLATE pg_catalog."default"   , price pg_catalog.float4 STORAGE plain
    , quantity pg_catalog.int4 STORAGE plain     , purchase_date
pg_catalog.date STORAGE plain     )
.git/rebase-apply/patch:2525: trailing whitespace.
-NOTICE:  re-formed command: CREATE  TABLE  public.test_drop_default
(id pg_catalog.int4 STORAGE plain     , name pg_catalog."varchar"
STORAGE extended  COLLATE pg_catalog."default"   , description
pg_catalog.text STORAGE extended  COLLATE pg_catalog."default"   ,
price pg_catalog.float4 STORAGE plain     , quantity pg_catalog.int4
STORAGE plain     , purchase_date pg_catalog.date STORAGE plain     ,
default_price pg_catalog.float4 STORAGE plain    DEFAULT 10.0 ,
default_name pg_catalog."varchar" STORAGE extended  COLLATE
pg_catalog."default"  DEFAULT 'foo'::character varying )
.git/rebase-apply/patch:2538: trailing whitespace.
-NOTICE:  re-formed command: CREATE  TABLE  public.test_set_not_null
(id pg_catalog.int4 STORAGE plain     , name pg_catalog."varchar"
STORAGE extended  COLLATE pg_catalog."default"   , description
pg_catalog.text STORAGE extended  COLLATE pg_catalog."default"   ,
price pg_catalog.float4 STORAGE plain     , quantity pg_catalog.int4
STORAGE plain     , purchase_date pg_catalog.date STORAGE plain     ,
size pg_catalog.int4 STORAGE plain   NOT NULL  )
warning: squelched 74 whitespace errors
warning: 79 lines add whitespace errors.

3) This file should not be included:
diff --git a/src/test/modules/test_ddl_deparse_regress/regression.out
b/src/test/modules/test_ddl_deparse_regress/regression.out
deleted file mode 100644
index a44b91f..0000000
--- a/src/test/modules/test_ddl_deparse_regress/regression.out
+++ /dev/null
@@ -1,7 +0,0 @@
-test test_ddl_deparse             ... ok           31 ms
-test create_extension             ... ok           52 ms

4) The test file should be included in meson.build also:
      't/027_nosuperuser.pl',
      't/028_row_filter.pl',
      't/029_on_error.pl',
      't/030_origin.pl',
      't/031_column_list.pl',
      't/032_subscribe_use_index.pl',
      't/100_bugs.pl',
    ],

Regards,
Vignesh