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 1nXq7m-0007SZ-EC for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 20:01:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXq7l-00016n-BL for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 20:01:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXq4i-0004kW-73 for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 19:58:20 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nXq4d-00064c-8K for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 19:58:19 +0000 Received: by mail-ed1-x532.google.com with SMTP id g20so10407040edw.6 for ; Fri, 25 Mar 2022 12:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=vR1eNSmESQ62JmMRfis0unVLSRLmht6uFo7ZO7h3nyg=; b=NtDblP8IR8v65t5WpkEANn08Xxap6EomXgsLfq3me+uTh7WPVqBAI2fOI0QAYFrlE9 tiCvvd2LpL80YlkLTauRj/+s5Vz5N32063Enb+rIeGWD3eGvAUKssC77p39jABN4h+gP /GoRvvRWHLjZagQ4gbh/7+/YqqpJOBSyZT7eyimXDfYiz7PyG0SJifnUkzohu0hPW8tv CPi6iTLoWj00JRVfHgP4kOgy5jehjBos4eU00tmdQnXdPXwr0J/tQ4LHmeFhfnul29+U bfK545I9fZtlhldd5aUeutuBKAJff+BjbMAhCTyPCee7yFDEVQzduFGe87h9hV0hokYh z7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=vR1eNSmESQ62JmMRfis0unVLSRLmht6uFo7ZO7h3nyg=; b=7RS9ogiwwkb72pIbXN35uA1i9fMRMJc47yaR6Z2xoEB2VgJTdH/K5+Llg+1KmXb3Ao MMmajAhsts0si8hD/JMtjtdJdTLWxbBLayHTet1ksvKR8qQnX3X7kE/6Xc3RywGkL+i3 ze/AEXvJcMPMZwgGoYzOmdZKf8vRLGTSB38kc2+CzpU+zubGAFoh97HvWvltLsT2Eymt u7r4FfB2W3zZWqY+O6ZZgrcpOGOi4+zMCZHbsXOSwRLHjSkm+g2qPu6u/eBRF64FjkM+ uk7ijjnIp3/vrAsLrejftugpLoFLFwnWEF1ze+lfY4V2TefNK8EsbbNQOhWo/vjvLhZl HoCA== X-Gm-Message-State: AOAM531tXHoHOLPYxgsLLKEN646VLtAivhIvmewG6moTUKfthlgx9U7S WAhmXuYEw8LxijHNKdS2xAMtfMwhpW8vQ0qgUoosmCS5H7zqXJRJXXZ9Qq5u/gDpH8cnQzXzfU1 eDHaF+jrVn7GfYAi+yRtQGtnOIfQ2+W9iND3ulkPlk8VM9WGonc7hSEqgP7EckHrh+mnTC6J8Ca 5dZuocoz7iYxEeKWwJIER3JM2CzH1zkjXMT630bMCowHaDfLhh60bS X-Google-Smtp-Source: ABdhPJwB30pAUzCwfsSBx9pYMkg1zIavqIFW5+Z9872XnEI0nbrJrbYAqRKq1caaIE+AQwyUddYIaA== X-Received: by 2002:a05:6402:1d55:b0:419:992b:9286 with SMTP id dz21-20020a0564021d5500b00419992b9286mr386608edb.235.1648238294170; Fri, 25 Mar 2022 12:58:14 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id hr13-20020a1709073f8d00b006dff3a69572sm2636418ejc.5.2022.03.25.12.58.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Mar 2022 12:58:13 -0700 (PDT) Message-ID: Date: Fri, 25 Mar 2022 20:58:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: logical decoding and replication of sequences Content-Language: en-US To: vignesh C Cc: Petr Jelinek , Amit Kapila , Peter Eisentraut , PostgreSQL Hackers References: <9defb937-20a9-1d9f-6972-f1c4b4da4f73@enterprisedb.com> <8e766e0f-ed3e-fd68-4b0f-10dd2db60c88@enterprisedb.com> <6b21233e-c880-e4ad-5df2-7832f769296c@enterprisedb.com> <9da788c7-01eb-f11d-aa08-c5f61fe9f33a@enterprisedb.com> <456A528F-8F19-41C7-9857-927024D32396@enterprisedb.com> <74729cc5-960b-9295-912a-a7c37356a0c4@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/25/22 15:34, vignesh C wrote: > On Fri, Mar 25, 2022 at 3:29 AM Tomas Vondra > wrote: >> >> Hi, >> >> Pushed, after going through the patch once more, addressed the remaining >> FIXMEs, corrected a couple places in the docs and comments, etc. Minor >> tweaks, nothing important. > > While rebasing patch [1] I found a couple of comments: > static void > ObjectsInPublicationToOids(List *pubobjspec_list, ParseState *pstate, > - List **rels, List **schemas) > + List **tables, List **sequences, > + List **tables_schemas, List **sequences_schemas, > + List **schemas) > { > ListCell *cell; > PublicationObjSpec *pubobj; > @@ -185,12 +194,23 @@ ObjectsInPublicationToOids(List > *pubobjspec_list, ParseState *pstate, > switch (pubobj->pubobjtype) > { > case PUBLICATIONOBJ_TABLE: > - *rels = lappend(*rels, pubobj->pubtable); > + *tables = lappend(*tables, pubobj->pubtable); > + break; > + case PUBLICATIONOBJ_SEQUENCE: > + *sequences = lappend(*sequences, pubobj->pubtable); > break; > case PUBLICATIONOBJ_TABLES_IN_SCHEMA: > schemaid = get_namespace_oid(pubobj->name, false); > > /* Filter out duplicates if user specifies "sch1, sch1" */ > + *tables_schemas = list_append_unique_oid(*tables_schemas, schemaid); > + *schemas = list_append_unique_oid(*schemas, schemaid); > + break; > > Now tables_schemas and sequence_schemas are being updated and used in > ObjectsInPublicationToOids, schema parameter is no longer being used > after processing in ObjectsInPublicationToOids, I felt we can remove > that parameter. > Thanks! That's a nice simplification, I'll get that pushed in a couple minutes. > /* ALTER PUBLICATION ADD */ > else if (Matches("ALTER", "PUBLICATION", MatchAny, "ADD")) > - COMPLETE_WITH("ALL TABLES IN SCHEMA", "TABLE"); > + COMPLETE_WITH("ALL TABLES IN SCHEMA", "ALL SEQUENCES IN SCHEMA", > "TABLE", "SEQUENCE"); > > Tab completion of alter publication for ADD and DROP is the same, we > could combine it. > We could, but I find these combined rules harder to read, so I'll keep the current tab-completion. > Attached a patch for the same. > Thoughts? Thanks for taking a look! Appreciated. > > [1] - https://www.postgresql.org/message-id/CALDaNm3%3DJrucjhiiwsYQw5-PGtBHFONa6F7hhWCXMsGvh%3DtamA%40mail.gmail.com > regars -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company