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 1qRcc1-002P6s-IB for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 17:59:50 +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 1qRcbz-00Fddh-TC for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 17:59:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRcbz-00FddZ-KG for pgsql-hackers@lists.postgresql.org; Thu, 03 Aug 2023 17:59:48 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRcbx-000NoC-7j for pgsql-hackers@lists.postgresql.org; Thu, 03 Aug 2023 17:59:47 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id CE5E532004CE; Thu, 3 Aug 2023 13:59:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 03 Aug 2023 13:59:43 -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=1691085582; x= 1691171982; bh=GdqkZ/Wp3cFIASybXzBYMVmdPXZQZr5C3q9OYz5KEmw=; b=H 5A67wxL/o0TQ8dILWvR1aN8mvLDaX/kxbVUgsiauNkjgJfsRzO5jZgQHETpBWAOI TXtOLx90xF6Ix9kaiSyVk+JcyvhzljaTiyC/FZJnZkUW8/o1+88G7GvjmaSWWKw9 EInEDOlgzWoueE/eOq4exVo6rZCyZo7xTtGdKT+Wyik4GaOAu4+qkN2P7D/ks7A2 3rRwBj8IOgmDlCTXPWRt/P3kVCLzEvlc6e5ATxfbGo64lU7ZPTIbaYf04IsqnG8r o9nn8ko/Hz2+rvG2ZfX2NcmC2g+30eRlQr5jTH/834K9PJo7EP8mJza6a0KAydEb 7GTYOjoFoj/D5QE9CF6Wg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkedvgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Aug 2023 13:59:41 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 71E1EE3; Thu, 3 Aug 2023 19:59:40 +0200 (CEST) Date: Thu, 3 Aug 2023 19:59:40 +0200 From: Alvaro Herrera To: Dave Cramer Cc: PostgreSQL Hackers , nathandbossart@gmail.com Subject: Re: Using defines for protocol characters Message-ID: <20230803175940.vf3os5y37c7vrbwl@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-Aug-03, Dave Cramer wrote: > Greetings, > > Attached is a patch which introduces a file protocol.h. Instead of using > the actual characters everywhere in the code this patch names the > characters and removes the comments beside each usage. I saw this one last week. I think it's a very idea (and I fact I had thought of doing it when I last messed with libpq code). I don't really like the name pattern you've chosen though; I think we need to have a common prefix in the defines. Maybe prepending PQMSG_ to each name would be enough. And maybe turn the _RESPONSE and _REQUEST suffixes you added into prefixes as well, so instead of PARSE_REQUEST you could make it PQMSG_REQ_PARSE, PQMSG_RESP_BIND_COMPLETE and so on. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ It does it in a really, really complicated way why does it need to be complicated? Because it's MakeMaker.