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 1n3KpZ-0007Ha-Cw for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Dec 2021 16:32:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n3KpX-0007if-74 for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Dec 2021 16:32:35 +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 1n3KpW-0007iS-PG for pgsql-hackers@lists.postgresql.org; Fri, 31 Dec 2021 16:32:34 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n3KpT-0004mj-Lq for pgsql-hackers@postgresql.org; Fri, 31 Dec 2021 16:32:34 +0000 Received: by mail-io1-xd31.google.com with SMTP id y70so33399574iof.2 for ; Fri, 31 Dec 2021 08:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TsYnz4FwOV3XMkwWW07cys+CUjytBTAW8lsG6iQI7eI=; b=tfucVjQYzAPLXkY0Jg356a0bcgArnlKashid/ZVNXuunqRHksi2qtdOjJZ07xbg90m lhtt1d2ITOQCQYgg5T0MxlcKz80dL+t8wGpr1CzAWvTV5DJIiTjHFoz7IRCr5fP+YqAr 4ex1LuH8RP+HNO88fQAK4LrIS2Z23SdCe7ayibgz4NXdWgmF4vUm5dfi4ZGOjLUfUIos nDiD1JS6YczrKu+Y0IGqby2sKSlsQvFrn8iFFo4AMhuOTIglGE2Drn+Si7vlaDL1R+5o 4ZpkDTQD72aa2oa3IEClNScL9V8PRJDds+2YyOBCxgxpHh19BgcmKzTYkzOhX/amOwyX jIEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TsYnz4FwOV3XMkwWW07cys+CUjytBTAW8lsG6iQI7eI=; b=O7HrfaU0up6X3m61kMwiDSevxSlMIHV9I7x00N7xUE3f4OrEWt4UHo+E1glp0MoV93 qIPJTMPsTvn8R0xT8ETph1t9PFdjJBii0Q20yxbQ4NskeftSFbRjRLQL15LKYYa3S8Wr 6yn3yW8tFCjTVzOVTgXbtH1hn7TxKmVXKIjiRiHl85np0eOqXsl2hobNaQDpqlngikjM 0xcuyjrHVM7VdhCIHl9ArEn6isMGBgWaELjAVoAQY2zGRrjCh5bG2ur4aKsMIETpD5uL BRajmfo0nzZ9U5QT3bzq5xOKvzi8haMimuoDBJIlYU+mx+xFIcjdgLrAXdvySlQjfzbX ZhyQ== X-Gm-Message-State: AOAM532BP57lWK5+34wZ7uXW1cp6RVIl9byoQR3eYEGwXCi52EI1vuVz YmgBpzn1CvYwn7+0oFrdVB9KEA== X-Google-Smtp-Source: ABdhPJzQpxzExVJr7Dt2bv5Ho1lQ4q/Dx8DOzZTr6xrvTf0ckMESnvPHrUq9CkLa8ehSNRVdYcTBLw== X-Received: by 2002:a02:6d4f:: with SMTP id e15mr15247200jaf.55.1640968349139; Fri, 31 Dec 2021 08:32:29 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n6sm12056210ili.33.2021.12.31.08.32.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Dec 2021 08:32:28 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C70B18008F8; Fri, 31 Dec 2021 10:32:27 -0600 (CST) Date: Fri, 31 Dec 2021 10:32:27 -0600 From: Justin Pryzby To: Alvaro Herrera Cc: Tomas Vondra , Amit Kapila , Peter Eisentraut , "houzj.fnst@fujitsu.com" , Rahila Syed , Peter Smith , pgsql-hackers@postgresql.org Subject: Re: Column Filtering in Logical Replication Message-ID: <20211231163227.GV24477@telsasoft.com> References: <20211230221634.GT24477@telsasoft.com> <202112302332.3dficrkfzcyt@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202112302332.3dficrkfzcyt@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > @@ -5963,8 +5967,20 @@ describePublications(const char *pattern) > { > /* Get the tables for the specified publication */ > printfPQExpBuffer(&buf, > - "SELECT n.nspname, c.relname\n" > - "FROM pg_catalog.pg_class c,\n" > + "SELECT n.nspname, c.relname, \n"); > + if (pset.sversion >= 150000) > + appendPQExpBufferStr(&buf, > + " CASE WHEN pr.prattrs IS NOT NULL THEN\n" > + " pg_catalog.array_to_string" > + "(ARRAY(SELECT attname\n" > + " FROM pg_catalog.generate_series(0, pg_catalog.array_upper(pr.prattrs::int[], 1)) s,\n" > + " pg_catalog.pg_attribute\n" > + " WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n" > + " ELSE NULL END AS columns"); > + else > + appendPQExpBufferStr(&buf, "NULL as columns"); > + appendPQExpBuffer(&buf, > + "\nFROM pg_catalog.pg_class c,\n" > " pg_catalog.pg_namespace n,\n" > " pg_catalog.pg_publication_rel pr\n" > "WHERE c.relnamespace = n.oid\n" I suppose this should use pr.prattrs::pg_catalog.int2[] ? Did the DatumGetBool issue expose a deficiency in testing ? I think the !am_partition path was never being hit. -- Justin