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 1oiUub-0002ig-PL for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2022 06:08:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oiUua-0001QV-Do for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2022 06:08:12 +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 1oiUua-0001QM-4W for pgsql-hackers@lists.postgresql.org; Wed, 12 Oct 2022 06:08:12 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oiUuX-0007kP-KL for pgsql-hackers@lists.postgresql.org; Wed, 12 Oct 2022 06:08:10 +0000 Received: by mail-oo1-xc31.google.com with SMTP id s125-20020a4a5183000000b0047fbaf2fcbcso9407788ooa.11 for ; Tue, 11 Oct 2022 23:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KvzERfISTvHePL5t6Fe421h+5xvG02LrxKVgJ9Jp7yM=; b=BOTOa2StUEiB/1HtM4irJunmatZJB/OpStSSj9iwZwDP4Dxf8eIf1jKW0KZajXrPul uOBYSQJneIfY5xrErLP0Yt1hl8H1BAPBmcBayNHRIWmJajz4HuRbLX2hZZ3x/yHGOexi 2mVqRxJQFGrwpres0+9IietIK3P3IOXZFs+e3ACFDABVdFV+T+7ooCKQxtLYP3VZ7yKm KT7ebRmoD28zv17lx1Wxu3YY6P+wPesHxHKPLRwapzA5o0GO2LfcgNnRQE+ZhDz0I3ie 1a9fAO4lSVHdha0tN7Oq+IZVPXiqVJUYforWHt83DxcTRH5Xeb+vuX4Px8Q3r8kE8VZA akgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KvzERfISTvHePL5t6Fe421h+5xvG02LrxKVgJ9Jp7yM=; b=ZvDogHamu92Gv4ZpXsxoJt0tye85OxvkDKgXVPvnMbORv3Nkryb2zTde69xIU3H4k+ y21r+EryHCdfifjKsNbH4uUGRMHVgczytQf8j9+6sKoEKpRgDH069a5Acwa+zAFekY38 XmnM49LBGdIfT2x2RoK8jeGXOVyddzhc5rEa3N8NJjrYgoYeEL8zehOmJYVKCP3dK2Lq r9qrlQaOYRAci2xGQkXjrgWO9nFygZR0mFH4bbp/JuXtPGe2/XenjDegGFJCIE46SzIq kXAzbYY3pJvB6fHEb7DKqYc2fyHJu7LYkkTRUj9z/YTm7jhymtAtjSn6esZ0yY4das1+ A1jQ== X-Gm-Message-State: ACrzQf261pkbyBCJdK7Ub4B2Mcby9lU2Lax7uyqikDwWlqDLScIITE1l wjC4aC7MIoHej8Ay7ATLqLVCYAt5UEB6pP9D+fU= X-Google-Smtp-Source: AMsMyM7ZP//P0SJFrXQ82OnJ7sGI/corO8nuMWunDKuVXd8V/nRanuIf5DyFgx2mw3QF2Sb8qvg0+et+/SlG7ECHJ7c= X-Received: by 2002:a05:6830:144:b0:661:b560:c053 with SMTP id j4-20020a056830014400b00661b560c053mr2109285otp.79.1665554888970; Tue, 11 Oct 2022 23:08:08 -0700 (PDT) MIME-Version: 1.0 References: <20221006171601.6um4ey5idm4h62vf@alvherre.pgsql> In-Reply-To: From: Dilip Kumar Date: Wed, 12 Oct 2022 11:37:51 +0530 Message-ID: Subject: Re: Support logical replication of DDLs To: Ajin Cherian Cc: vignesh C , Zheng Li , Alvaro Herrera , "houzj.fnst@fujitsu.com" , Peter Smith , Amit Kapila , Masahiko Sawada , Japin Li , rajesh singarapu , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 11, 2022 at 7:00 PM Ajin Cherian wrote: > I was going through 0001 patch and I have a few comments/suggestions. 1. @@ -6001,7 +6001,7 @@ getObjectIdentityParts(const ObjectAddress *object, transformType = format_type_be_qualified(transform->trftype); transformLang = get_language_name(transform->trflang, false); - appendStringInfo(&buffer, "for %s on language %s", + appendStringInfo(&buffer, "for %s language %s", transformType, transformLang); How is this change related to this patch? 2. +typedef struct ObjTree +{ + slist_head params; + int numParams; + StringInfo fmtinfo; + bool present; +} ObjTree; + +typedef struct ObjElem +{ + char *name; + ObjType objtype; + + union + { + bool boolean; + char *string; + int64 integer; + float8 flt; + ObjTree *object; + List *array; + } value; + slist_node node; +} ObjElem; It would be good to explain these structure members from readability pov. 3. + +bool verbose = true; + I do not understand the usage of such global variables. Even if it is required, add some comments to explain the purpose of it. 4. +/* + * Given a CollectedCommand, return a JSON representation of it. + * + * The command is expanded fully, so that there are no ambiguities even in the + * face of search_path changes. + */ +Datum +ddl_deparse_to_json(PG_FUNCTION_ARGS) +{ It will be nice to have a test case for this utility function. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com