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 1nCJTC-0005Qw-CT for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 10:54:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nCJTB-0007QL-5E for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jan 2022 10:54:37 +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 1nCJTA-0007QC-S9 for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 10:54:36 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCJT7-000886-Nx for pgsql-hackers@lists.postgresql.org; Tue, 25 Jan 2022 10:54:35 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 38C703201F73; Tue, 25 Jan 2022 05:54:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 25 Jan 2022 05:54:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rUqbJmbvYzKTpx+u5WAmDWZRy7SULmN6JBYW/QUof BU=; b=a4sEJEHe5guFLNAzQv0AUmUYRAn6X7MrUo5/sn6BHsoIYeBy2QzoiAEUS /zFMij77kkXunc0aHZIQ7yUZXeNTfaRNJYGj5Ugo2BpMlZSinjveYIWK4Ie2UYNv n1J3S67Wddn71p+Fdsf7j2tPyp/T6IhhGDTBsfDTz27G0/Nwz2RNmR9I925Uv7qG NDA5/g8HGXKbGwt8XZNSfzwXmaT1MipzmAj0xlNI4QZYRwxHv8m7bh3WqjYt8GZd jT8gr5dTCQF/pGeMYgObfN+i2KO+zBqwI6aZggdK5BF1rdp2gdxlOMNaqTz3Iwq3 67vubF7Cd0IuAyEMvKsqgtNBhYeaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvdelgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeeugeeljedvgfdvjeeiueei ieevudefvedvffegkeffgffffeegvdehieeuvdfgvdenucffohhmrghinhepphhoshhtgh hrrdgvshenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Jan 2022 05:54:30 -0500 (EST) Message-ID: Date: Tue, 25 Jan 2022 11:54:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: PublicationActions - use bit flags. Content-Language: en-US To: Greg Nancarrow Cc: Tom Lane , Alvaro Herrera , Peter Smith , PostgreSQL Hackers References: <3b7f2bdd-77ed-00d7-437c-dd9c37e6a2fa@enterprisedb.com> <202112201714.ql732mnfdrtc@alvherre.pgsql> <2683410.1640048186@sss.pgh.pa.us> <6b8191a0-e0f6-b204-e6c0-f7f1a5f349c0@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 25.01.22 07:14, Greg Nancarrow wrote: > > On Tue, Jan 25, 2022 at 7:31 AM Peter Eisentraut > > wrote: > > > > Why can't GetRelationPublicationActions() have the PublicationActions as > > a return value, instead of changing it to an output argument? > > That would be OK too, for now, for the current (small size, typically > 4-byte) PublicationActions struct. > But if that function was extended in the future to return more > publication information than just the PublicationActions struct (and I'm > seeing that in the filtering patches [1]), then using return-by-value > won't be as efficient as pass-by-reference, and I'd tend to stick with > pass-by-reference in that case. > > [1] > https://postgr.es/m/OS0PR01MB5716B899A66D2997EF28A1B3945F9%40OS0PR01MB5716.jpnprd01.prod.outlook.com > By itself, this refactoring doesn't seem worth it. The code is actually longer at the end, and we haven't made it any more extensible or anything. And AFAICT, this is not called in a performance-sensitive way. The proposed changes in [1] change this function more significantly, so adopting the present change wouldn't really help there either except create the need for one more rebase. So I think we should leave this alone here and let [1] make the changes it needs.