Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2u1R-000iHt-2p for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:45:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2u1Q-00CUra-1t for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 16:45:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w2u1Q-00CUrS-0M for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 16:45:28 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2u1M-00000000OE0-3L4n for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 16:45:27 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5a13a06fc85so64370e87.1 for ; Wed, 18 Mar 2026 09:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773852323; cv=none; d=google.com; s=arc-20240605; b=U0zg2T6DMLXu0wLhRFC8EYjSf/RsCvfCISh1FHVW1Ph0A3VvB/zyy79jp0k/rx8HEq BNb/mwcus+hs39S78bLhEjgRqhiUn6gjLQUKOPGkhmtG57vSlFIAzZmF+BA6afsEJu/T VOYy4eMvVc+C29P+IgjN+vKwAfayQL3+1NRdPECMFbnT5sgEEj0q77MtY6/wspYD4M2K 5RT7247gwWI/440Z7/k4T6lhb5ZaUIc8QyRos09j4zgLxQiW+LyE2t1EgWrUoIemIPvB xfGthkeex/SeMi+UZ4CJ58IHAMGXggryudmPUBSbkGFrd2UmmRWsRtWL279Ffa+KcZVo aCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=P5pu4e4b7TMDUlgN5TCa8vNKNCMBvcmSSqjsSvMVYtM=; fh=iB2OFTg05OSOfZ5UqjzQvKnbPG1CncJT5dFXkheP7Lg=; b=bRQfUoMqp5d0Kgv0WV6D7kYXyps8m3ynqnvZ6J5LH0vz4jbgUsa2WQSuXy9Bb/rL9V tdukWIn0/cXygM6/ZR2z/Sk+3a6AQoJpsP5XvKFxCbFqO57HmhqJ/zh7xitdhSG62iz8 9PqE3lt5T2mlIuwiiHn9qCFHJE75rccCQc8RniIgTEJF1Dl3IUXZ7wCDrkVTWQ5nuS9u /exhW5ktM5859tdIxfzCJcNfEVysa0hPr2ewBQzsGt13kEwN8TBY6AAAHPaQHNqNE+RX MMp4PXZImCg5nmKZ1om86B1KDBz5ComW8d98jAKXelqFZ7RM9CUqLlqlAJP9W5wd8JHK eWDg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773852323; x=1774457123; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P5pu4e4b7TMDUlgN5TCa8vNKNCMBvcmSSqjsSvMVYtM=; b=DW5LZriBPUPM2P0LrtvsZiqXCEWbK26/DJKLVVgnqnAakLYqH/aqqniCVVsIiZBpaZ BNX6VDqBi+vxd8raOHvM9FMrr3ch7ftcup2rY0tuizfemQ5g4mcvdpWZNrWZPmOKHzoq asl/uuPncG+Db2wLgktcRbK4qBGM2mYKzkePNA5x5rEN0dky6NLm5EDT2J5n+AE390o5 qmdSXYGKmquy9V2qin/rmqAfWlvQy/X3k01r1KA2+CU0FoWh3TABdBNmJAA3DS0js8bC JUFzlty+mbt/RL/tQGW8jIlkW8kfiTz7O+avlexNOv2j4CSiywgKagpifXNHGqSdZrXW JkYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773852323; x=1774457123; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=P5pu4e4b7TMDUlgN5TCa8vNKNCMBvcmSSqjsSvMVYtM=; b=HqaUDRn/8X/9xhH4X3P4YA2w7FBOloFg2a+mZ5T0cvauZnepMFrqciOzrdtq899KA2 LJ1N8+QwXNr/0cvHTHsWuybUtrG2goOgrAXEOnPTrezP9ivqPrxtMTw76qBD9wXHCdQN DLCJbad+X1M8zE3Zo7oEYLZVtPdIjddK/AkPEierqjjGsOLJiu5TH8I6hX2Fvmw2kx2B TVMhluyt6BaW81UuhXhFm4ku/VrhS3b1si3xoXNJezkV+t/0v/LEAInH47wRKcJY0Ztk lRFy4/zi568DUaUM4ARsGwdSQIb0SDil3VHnhtihm8qifBcaeDl219fdXNVaCm14idw3 Bxcg== X-Forwarded-Encrypted: i=1; AJvYcCVJI1TA7EZkxykZkG4lavZ19DdFX7Cfjx/yGS+Q1J/VLE8SVudAbO8i9Qerxdq4zHvEcjkels3DkNq4ViWf@lists.postgresql.org X-Gm-Message-State: AOJu0Ywei7Ycrb1PxGVg+ttk6C+72WX49hWhMfFpoI1WMyq5A3nlE89Z ZlBOGrCkwyMS527uGGkPphrLlYHw6aILQABDCwLZR8SbYA65avHm6O2VmTcPFhGqd3nLbK5MuT3 wLCNBSmBlIu6OgyCH1spHfUXAWR9SaBE= X-Gm-Gg: ATEYQzxam00miI/rSRS4POB9poPG0TOFn5wcV9XDK8jwBRlXWMUZ0fG1Sq3BggAllW+ jFAwQc2nbTaG+L0/gtrnjmleWuhEtSKzYnEa+SN4IPPITEHJPBZ9HWcToeQAQw99IJIwtGRLIc/ KttXlTwm+fybD10NdrJRUx8U9gxtXjjoV3USRPnXuH5NNl5rCjY2aWUTqLnk/en4cMW34S09aoZ k9xJ2tQwQ9GoWTiza7kIbP5Bv5T+tU4UE4+I+VwAT2lxenYpffzCor8v8u5dE+pm7igEdV2INf+ +3PfXxHn X-Received: by 2002:a05:6512:340f:b0:5a1:3bb3:9ff4 with SMTP id 2adb3069b0e04-5a2796ae54emr1753297e87.33.1773852322894; Wed, 18 Mar 2026 09:45:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiko Sawada Date: Wed, 18 Mar 2026 09:44:46 -0700 X-Gm-Features: AaiRm505NeO-iAFsYfIoGUl2wkD53ndRJl6wFsUmLWWVEZwdUlkl1z6zUxEgQis Message-ID: Subject: Re: Initial COPY of Logical Replication is too slow To: Amit Kapila Cc: "Zhijie Hou (Fujitsu)" , Marcos Pegoraro , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 18, 2026 at 6:56=E2=80=AFAM Amit Kapila wrote: > > On Tue, Mar 10, 2026 at 3:40=E2=80=AFAM Masahiko Sawada wrote: > > > > On Tue, Mar 3, 2026 at 2:22=E2=80=AFAM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Saturday, February 28, 2026 7:48 AM Masahiko Sawada wrote: > > > > To: Marcos Pegoraro > > > > Cc: PostgreSQL Hackers > > > > Subject: Re: Initial COPY of Logical Replication is too slow > > > > > > > > Another variant of this approach is to extend > > > > pg_get_publication_table() so that it can accept a relid to get the= publication > > > > information of the specific table. I've attached the patch for this= idea. I'm > > > > going to add regression test cases. > > > > > > > > pg_get_publication_table() is a VARIACID array function so the patc= h changes > > > > its signature to {text[] [, oid]}, breaking the tool compatibility.= Given this > > > > function is mostly an internal-use function (we don't have the docu= mentation > > > > for it), it would probably be okay with it. I find it's clearer tha= n the other > > > > approach of introducing pg_get_publication_table_info(). Feedback i= s very > > > > welcome. > > > > > > Thanks for updating the patch. > > > > > > I have few comments for the function change: > > > > > > 1. > > > > > > If we change the function signature, will it affect use cases where t= he > > > publisher version is newer and the subscriber version is older ? E.g.= , when > > > publisher is passing text style publication name to pg_get_publicatio= n_tables(). > > > > Good point. > > > > I noticed that changing the function signature of > > pg_get_publication_tables() breaks logical replication setups where > > the subscriber is 18 or older. > > > > Why adding a new function with additional parameters (Oid relid) > couldn't help with such a case? I am asking because your previous > version code looks simpler as compared to the new patch version. I tried to pass a relid to pg_get_publication_tables() but we cannot avoid changing its signature because it's a VARIADIC array function. The previous patch changed pg_get_publication_tables(VARIADIC text[]) to pg_get_publication_tables(text[] {, relid}). However, changing the function signature would break the logical replication from v19 to an older version. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com