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.94.2) (envelope-from ) id 1t3Uly-00CtGR-My for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Oct 2024 06:23:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t3Ulw-006n0l-PZ for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Oct 2024 06:23:09 +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.94.2) (envelope-from ) id 1t3Ulw-006mzX-Fy for pgsql-hackers@lists.postgresql.org; Wed, 23 Oct 2024 06:23:08 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3Ulu-002PFd-7C for pgsql-hackers@lists.postgresql.org; Wed, 23 Oct 2024 06:23:07 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 98D661380190; Wed, 23 Oct 2024 02:23:05 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 23 Oct 2024 02:23:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1729664585; x=1729750985; bh=JrNmSRHdxh fVQco2KvghyR2jCtYu4bH5Eun0BrNnpbE=; b=bWUSSSvu0IH5uUMDAOQyWbxr7n yQAYRSiiYj6Pezcxxxx5fsyqmxR1ASIwM+hrNcZThBK6XpL3X0A2b4VI6gwh3u2V iLIY3MINZnDDVkk1A7x9KRdzGaPjuNWWqF1JaeecCHDN6zD8W8OEmKx9G/kJWieI gcBLmD2hX4HvDdPkA+Un345ngXBT6Mnxnfm4CDRcXBLq1c94qDDD5vGR3628BFZ1 zCxxrsNSfLgdZOmZ3zOMWwA/R9LgiZIFmqHUsFsbzTYHtWVhXCirsfArtH53f1uf sfbWS4fjTQopyjMgbYgUhkbOCGczbwZ7mLy3N00PNdILqnHnOh4YVsWNwDCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1729664585; x=1729750985; bh=JrNmSRHdxhfVQco2KvghyR2jCtYu 4bH5Eun0BrNnpbE=; b=MHJNi8YMIh/6CfsmBVIEJSmyQS87HybULj6Jwq0stErg drsqaAiOSRkAYuDGAlIAy6Q3YsfUyBw5eW8dqbVhq5Nnr3mi4C1o4syvNUmuLXDw jLrCNBx7foXIc60qtsl7lqhPgyQKbBGcdBvNQR3pehKHRhNfmiFURTqGQp/QqPUq ZM7Y91n+qzHyqy18Hu0ytWLfAQraFi6tVxO67CcRNG26DOZj3uW8Vc1X24iNa2SU V2/fkelofi72F0iEhZGSRIThUShETO/9pMpvpcx3fpNQlhnqNfOprI1CpkqajIL4 JNcN50EnZnBRfMmKKbJ5el4JOsoz+yKGykQKIrUaMg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeiiedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffk fhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrh cuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeet leeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghl sehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehsmhhithhhphgsvddvhedtsehgmhgrihhlrdgtohhmpdhrtghp thhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrd horhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Oct 2024 02:23:04 -0400 (EDT) Date: Wed, 23 Oct 2024 15:22:44 +0900 From: Michael Paquier To: Peter Smith Cc: PostgreSQL Hackers Subject: Re: Refactor to use common function 'get_publications_str'. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TAdTv9wUL80Ze3o7" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --TAdTv9wUL80Ze3o7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 23, 2024 at 03:44:03PM +1100, Peter Smith wrote: > During a code review, it was noticed that there are several places > within logical replication where a comma-separated list of publication > names is built explicitly. There is already a utility function (called > 'get_publications_str') for doing this, but it was not being used in > every place it could have been. Agreed that this is a good idea, saving from some duplication in the tablesync code where the same thing is done, with the quoting on top of that. - pfree(cmd.data); + pfree(pub_names->data); The pfree for cmd.data should still be here, no? And you would need a pfree(pub_names) as well, meaning that this could just use destroyStringInfo(). -- Michael --TAdTv9wUL80Ze3o7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmcYljQACgkQnvQgOdby QH1hkQ//XucWh6ynmJzx4n48FMSvltyc/mnMZgURCEFOhscjMgW4bqKjrh6jKmPx /A8MzjtQsl+kB4G2Fp0DPxMGtO5D6pNoMdJw+/nmp3EExn7uis+8hr/Jpuc4jLtS gfn5S5OrDUuUTi1nmm4hIGIooufA3eqGhXRkMMbFBxcaMdKrlnMBNd9BEV2hojKz 19mQ9TSGsNGI/LnFJFvdMounVGG2aAeT7IEn/Pi+GnwSk/d3f2NWtyrLHJV7AWKC zsac90kWZAbgemIinFSVShcYjTyR/3S1XLBw+M+t9H71RGyJFyB99A5gkqgIeebS 36WEfW5n3176im4fzdn2T+awDTKGfVCM6AdIxbv6XP7+9KtiDWXPu6iEc3y1x1VB nbx1ddw2GlZsgJL+ONbNkQi6m8R5zz/BKUMOswjAUwxtGUroPOq7vKVM+oaF55NP uUV34KtH8Yy/FK04I9QXA4Pc7So1TakUhEqDXGTR1UrV/Znf2gCLUvhzoI8PCj/u dSzJEI5MMWjzIB8ox4ta6F0GyVQHGVlRTuL7vhexUcZWlpctj9AaiQcnjeLNMZdE 09CEW4S3OLWc27BtmmHbI6wHfpTyeUiDByuqCezdZYCxKghFMIhRPSMEv0snEio4 sbgv3lkfXulyGEZAYO9Mwqiug+3uYTumO4skap48x8jDWYKIuOY= =fJcW -----END PGP SIGNATURE----- --TAdTv9wUL80Ze3o7--