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 1pu9LE-0007tK-6d for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2023 10:04:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pu9LC-0004v1-Pf for pgsql-hackers@arkaria.postgresql.org; Wed, 03 May 2023 10:04:06 +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 1pu9LC-0004us-G3 for pgsql-hackers@lists.postgresql.org; Wed, 03 May 2023 10:04:06 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pu9L9-000K1D-L7 for pgsql-hackers@postgresql.org; Wed, 03 May 2023 10:04:05 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id F271D5C003B; Wed, 3 May 2023 06:04:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 03 May 2023 06:04:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1683108240; x= 1683194640; bh=D0/3OGqz0OjTTBOQNrHyotCEWtBcMgbQsAt9kFrRQz4=; b=e 5AzBkK4g5x72HOFiVhLWwvKdo6575sVWy8b+kPmTg2geolzRHsLeL8r3c3cvTDak QP7taQDQ0vcXMngR1Yp77WIozBysTaG5V6K4XEXmTVO1TaSg+zUjMLxg19VedLtL 1ijy7BRIX8akjEyaHJtxw/TX7RmBPrdoLb1U5WNyw4R3UOfhBWR0oY+8djvT/UYA hqrGWnF3mwVGehfySI7w6GgZhF4IF+N1PM6JKIyjtQUProky1Ok8mNH8eqofUZaT cnZk8z/77iMwJZ2G4W5SdmR4q01AUK1T0/Nlv6G8l+/RgTvjto8yTev8ECtmoZJQ oHivfFGtCqIlFItR8PGgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvkedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddt tdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrg hlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeektdfhkeevudeugfeu leetkefgjeegkeeuudduueevuedvudffgffgteeihfdvfeenucffohhmrghinhepphhosh htghhrvghsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrg hlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 May 2023 06:04:00 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C68A7A0; Wed, 3 May 2023 12:03:57 +0200 (CEST) Date: Wed, 3 May 2023 12:03:57 +0200 From: Alvaro Herrera To: Robert Haas Cc: Michael Paquier , Anton Kirilov , pgsql-hackers@postgresql.org Subject: Re: Add PQsendSyncMessage() to libpq Message-ID: <20230503100357.35enoibsgtsqvsjt@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-May-02, Robert Haas wrote: > On Mon, May 1, 2023 at 8:42 PM Michael Paquier wrote: > > Another thing that may matter in terms of extensibility? Would a > > boolean argument really be the best design? Could it be better to > > have instead one API with a bits32 and some flags controlling its > > internals? > > I wondered that, too. If we never add any more Boolean parameters to > this function then that would end up a waste, but maybe we will and > then it will be genius. Not sure what's best. I agree that adding a flag is the way to go, since it improve chances that we won't end up with ten different functions in case we decide to have eight other behaviors. One more function and we're done. And while I can't think of any use for a future flag, we (I) already didn't of this one either, so let's not make the same mistake. We already have 'int' flag masks in PQcopyResult() and PQsetTraceFlags(). We were using bits32 initially for flag stuff in the PQtrace facilities, until [1] reminded us that we shouldn't let c.h creep into app-land, so that was turned into plain 'int'. [1] https://www.postgresql.org/message-id/TYAPR01MB2990B6C6A32ACF15D97AE94AFEBD0%40TYAPR01MB2990.jpnprd01.prod.outlook.com -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "No nos atrevemos a muchas cosas porque son difíciles, pero son difíciles porque no nos atrevemos a hacerlas" (Séneca)