Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVM6R-0000mL-AC for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Mar 2022 23:33:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nVM6P-0008JG-Oj for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Mar 2022 23:33:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVM6P-0008J6-0N for pgsql-hackers@lists.postgresql.org; Fri, 18 Mar 2022 23:33:49 +0000 Received: from mail-sy4aus01olkn2082e.outbound.protection.outlook.com ([2a01:111:f403:7005::82e] helo=AUS01-SY4-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVM6I-0008Bl-17 for pgsql-hackers@lists.postgresql.org; Fri, 18 Mar 2022 23:33:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sh9oYYi5k0bZH2YX27jcU1hzlsgwsgsyaPFE5k/PtMRjRE4U6My0hTIzBAlKYlWByojW1wkckpgOY0d+L2Gc7ux2hwRlOvQKH5wXmqUPK1gCni5b+vajtgRHHBe8y8PiHxQU55mZEZa4ScrxQUi7Bh9uX4YZoTOwxXmnQvxVTUQjunjdAobnGGMxebXtzAODj0fP2SaEYpzemjL4kMJ1briD2KKZCxUnxFEwzb86yNvXOuFB2gpZUrEyJH+K4awIdRwkzoThFMJ3fTK9GDzw5NKP9BPNl4YrdqU31lmEemRMhcWRK8phlKPnthCnRZbYzOEDBGSm261esYSb5ymsvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o0PIOgxvnewqOM1q64fVoANGnr5u+JQJ0lbflxa4eow=; b=gwmf3XlsFjKBBaU/J3vKcHXRk2WhwurMAjRsDX86o21jzdcJUnkHNdg6O0s22pbyyz0eJsA9cfxX7ul1j+GHP+c5K84gumS5aDflMVymphY7cHjCDmD7TyGYsf6pnNT5YyiOHBdyfvBu0Xu7FLmD9O3sIBQV4Qn/yG6TqSw1mywpvjIavsGgC49Z7/CC8vuPPhKiWCYTH6krwtKwItAvUjpedDVNfqdvUgThpgssIB1dMSPB28rSwnFQyNp4fKNXsHhrZKsqC7LrNq7woDOfJ/qk91vs/BcxDkRZbilDDU1x1r4EjLpnqyD2iK9vikbdIQ30Lwr0wpEaRZ2ipDCxDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o0PIOgxvnewqOM1q64fVoANGnr5u+JQJ0lbflxa4eow=; b=cuH0+HefOrhb/A1Sgu1qXac/gtzMuHdAH2IfJZY5vQloOOaCROPdQGjrldL27Zlr9IOmXpALQz8mYhsMmuLxoqsV0ldh8LNF0ZJDreNdZP5pjF97PFrHVPSMzjEohNW27OjCO9LxMEzPmeIE3lxu+5qCq9Kc06gPIl1XGPpc7BYBkrNWDoE+4UoET38RBeGGkKsxQCV3W0Gqjw+9rRa6I9+gXS3rZx/x4PBsseEw561oB5n6u0YvDffXJcSin0XoDFnS0sInh6NuVYTTRK6ToGBxsI0sKpwlRUE5hU5/ECGf7LFNwettQr76Hz0yk0HDWcqBlKyTEHJkulaW6yWfiA== Received: from MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:c3::12) by SY6P282MB3434.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:171::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.18; Fri, 18 Mar 2022 23:33:34 +0000 Received: from MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM ([fe80::d98e:eb30:1192:e1d2]) by MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM ([fe80::d98e:eb30:1192:e1d2%7]) with mapi id 15.20.5081.018; Fri, 18 Mar 2022 23:33:34 +0000 References: <202203162206.7spggyktx63e@alvherre.pgsql> User-agent: mu4e 1.4.14; emacs 27.1 From: Japin Li To: Zheng Li Cc: Alvaro Herrera , Dilip Kumar , rajesh.rs0541@gmail.com, PostgreSQL Hackers Subject: Re: Support logical replication of DDLs In-reply-to: Date: Sat, 19 Mar 2022 07:33:29 +0800 Message-ID: Content-Type: text/plain X-TMN: [p78GVHjDOW2jfgvLSN8ufaFHMSu9wQB3] X-ClientProxiedBy: HK2PR03CA0047.apcprd03.prod.outlook.com (2603:1096:202:17::17) To MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:c3::12) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6cfdcc9f-0e47-423d-8da3-08da0937b822 X-MS-TrafficTypeDiagnostic: SY6P282MB3434:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWZ49ApFWBS7RC88vhrh07HYyohyG+DL5pPet9MRT+JfYIyIITYXc/wiLZsSxHijInZKma4C/pu6TqOUVV1KD0pVRc70LMs8x9l+h/QMbqw42xBonESXIJ4hLiu0jyXMoY297k8D/0slVfgWHQ756B0iKM8eu4BgD+FUge5bZ2ssvqGn60q93LWwQazOvJluxh3giAVkt6nDv/UPf+AAs8zztX6Mznys6uOJr3rWbaZ+Ue0iI4Zdn6Zxq1U2KY4KjVO3Q1mDpsFic25BdNka3RADAGPPsFS2WSMdJayXTWVWNgWK37i6vUNBQhN1aEWSrXi8iFzUHc63PPmooS5gXAPRc9TMSJM8MtZtNhEIS557u+0YSvv/ZkLbab+uwu3CPnc/dc9DI+crHZdzZms/T2DIRVjmDa5ZkpU2NBetv8VV6mkYiuUPk1Z0kK+iAmKh7opENwxzrL4bcBIdFaOeiC0yOGW4NRyCwQwiJeIdxR0maOsdxFiJup2Qllf6vk3ThFTkFsoWfbFmwNmPAesn8eGIXoO1GfBiRFE8suJAjyfeqXy0Bl/ifkE8076DuhTQK/n2d02Z8EMbReWH1vjjFpT+ah/07QiWcoY0FrFT92GAbCjKILtePZTWcbfGyJwe X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MP65Lxm3E3nmgQztRon++cmLXU4xkw58X5gXYFWAud0kDQ3iRQKOSuqwD9aP?= =?us-ascii?Q?dea39JAz3AfIR+yKM7tceZOOeReWRctl/DdqFNJMItE/nKtqqKs51yOOcB0B?= =?us-ascii?Q?pGEx2c+JpCAdh8bqtW350IS/8KJ3NNevFfMqeLODKj0k7AgwsfStC3M051LO?= =?us-ascii?Q?KmkPM51UmhQXvdsFgHu+Zle2pOPyKhixEMaQ9ERmetW8bO5duEfuB9ftryKO?= =?us-ascii?Q?gv1kgIJsKD8+OOEaILNaS4oHtjT376tis+1b+92bBKSHtAMZR6ct82gYB8oI?= =?us-ascii?Q?NLqWVnR+9uDwkFMoLxV0Lb1sElf4f/+yGrDJfNfoAkdbwwjPfBBibGHQV1fB?= =?us-ascii?Q?7ZpXnRWbQqjLSo0cBXj9oaxtEz3ePiBW2ZcNojQFyk7oJqWiCJZFdIm2t2Jq?= =?us-ascii?Q?YzKxzxYMDoXPqbWlqu0epym5yVXfHbtUpogKBrYvxfCg3XC3cX3UMvaRJY2o?= =?us-ascii?Q?i564PapJFVTexP4DY3Hi+VKnsDNuPcaZ8sddgXw9Xg7GcWFImaPopX+T7lW5?= =?us-ascii?Q?ayHizsmO3Y5j/dXqyqdLrp/CM+Sul3iqDEsPVo9FIWXYTWTMrtqzlcu3OV+Q?= =?us-ascii?Q?ZzXzGn+5ylJ8RkjLakLzdRZKoMU9upYFC1qLL569tYNHbqzBPNIrQorufgIr?= =?us-ascii?Q?lF77w6EALvOJSRUyb4nH9NTNojq6+rXpLFFJQeas/LLxMB/q5/d9QhZdWLSq?= =?us-ascii?Q?0WpXWgAojgswhcLvzflqDXwoxWnB4uGQ3JKbkeNTZuk8vE67a5+TuZmjqEjD?= =?us-ascii?Q?KjwZtKpfReJc8scGyVIXPphbw/GZXlZ+EdwywpCCUpYkqPw464JYmIxGKv2F?= =?us-ascii?Q?YsiBeMKBw1SEwW5VHzhJViT0QPqEk9WUICCx3Gu/XOnefUs+NROFUr+tv5yx?= =?us-ascii?Q?0lrwIGn5bnMQUtBsYZI+l14NvpW1BF/+UUTp00AwtyLQI9NSm8K+Lwln2qpV?= =?us-ascii?Q?LrIKIx/Z7U1fx4EAn8+YNdn/NnoxBscsJAEiTSlYey/nUrkPRNOrq3RYDtAZ?= =?us-ascii?Q?+0Q2i2cBHOEUJqgfI+9yuPuqTWxS7TayCnMbTbbOCCVqpmAneDdK9RXA0dwy?= =?us-ascii?Q?zaiPqNVLKdXpcvrS4QiAfLensHqojToVjIPD1VeqF+2l75nE7MJ2F2pNGK0X?= =?us-ascii?Q?CX7Ie3+0v8kyv6caWiKbYmkcEfZX382fSQ=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-746f3.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 6cfdcc9f-0e47-423d-8da3-08da0937b822 X-MS-Exchange-CrossTenant-AuthSource: MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 23:33:34.7208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY6P282MB3434 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 19 Mar 2022 at 01:25, Zheng Li wrote: > Hello, > > Thanks for the quick review! > >> And, when I try to use git am to apply the patch, it complains: >> >> $ git am ~/0001-syntax-pg_publication-pg_dump-ddl_replication.patch >> Patch format detection failed. > > git apply works for me. I'm not sure why git am complains. > I also created a git branch to make code sharing easier, please try this out: > https://github.com/zli236/postgres/tree/ddl_replication > Yeah, I can use git apply, I'm not sure how did you generate the patch. >> I also think that ddl = '' isn't a good way to disable DDL replication, how >> about using ddl = 'none' or something else? > > The syntax follows the existing convention of the WITH publish option. > For example in CREATE PUBLICATION mypub WITH (publish = '') > it means don't publish any DML change. So I'd leave it as is for now. > Agreed. >> The test_decoding test case cannot work as expected, see below: > ..... >> DDL message: transactional: 1 prefix: role: redacted, search_path: "$user", public, sz: 47 content:CREATE TABLE tab1 (id serial unique, data int); >> BEGIN >> sequence public.tab1_id_seq: transactional:1 last_value: 1 log_cnt: 0 is_called:0 >> >> Since the DDL message contains the username, and we try to replace the username with 'redacted' to avoid this problem, >> >> \o | sed 's/role.*search_path/role: redacted, search_path/g' >> >> However, the title and dash lines may have different lengths for different >> usernames. To avoid this problem, how about using a specified username when >> initializing the database for this regression test? > > I don't understand the question, do you have an example of when the > test doesn't work? It runs fine for me. > You should use a different user that has different length from your current one. For example: px@localhost$ make check-world > >> t/002_pg_dump.pl .............. 13/? >> # Failed test 'binary_upgrade: should dump CREATE PUBLICATION pub1' >> # at t/002_pg_dump.pl line 3916. >> # Review binary_upgrade results in /home/px/Codes/postgresql/Debug/src/bin/pg_dump/tmp_check/tmp_test_jgRI > ...... >> Failed 84/7709 subtests >> t/003_pg_dump_with_server.pl .. ok >> t/010_dump_connstr.pl ......... ok >> >> Test Summary Report >> ------------------- >> t/002_pg_dump.pl (Wstat: 21504 Tests: 7709 Failed: 84) > > This is fixed in the latest version. I need to remind myself to run > make check-world in the future. > Thanks for updating the patch. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.