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 1qRrMr-003PCn-Gx for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Aug 2023 09:45: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 1qRrMo-0062Mn-Oc for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Aug 2023 09:45:07 +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 1qRrMn-0062Me-Kg for pgsql-hackers@lists.postgresql.org; Fri, 04 Aug 2023 09:45:06 +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 1qRrMi-000W9K-DP for pgsql-hackers@lists.postgresql.org; Fri, 04 Aug 2023 09:45:05 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 4E073320083A; Fri, 4 Aug 2023 05:44:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 04 Aug 2023 05:44:56 -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=1691142295; x= 1691228695; bh=pgUDRc7FeL7Hlpa5Zdw5vx3SzsLZHi9nnz+LCfC2RnA=; b=U zx2l12HxoFihB0ZpkDcWT8vtpdWR4B12Styb1bz5IkX7GdDO86AKwbbgWKTAgKp4 bA9Gdg1tn6FP8xpMdH2czhycJ0yaibVxm/gztWrYSMdcmIC7ikE6i/8q9UroVbtj z323jskoCEwJjHKdUbCxF684VBPYPerzak4idELQRHVfO7LiLVBvgpW4MAMLaRl5 8Hj3zPPnjLoRUncYVawWjybAWgvaoD3ZzW4dtVY18CnLbLORcs0HDmTnDj0YV4CT lDkRdvOwrf74QbrXbqkT+jDvPGg+xCTXj0PJmam+E8nCZSSrjoDvrZTNVFnw+bim Ls/Tb5v5yfhivtkaKMN3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrkeeggddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Aug 2023 05:44:55 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 050FAE3; Fri, 4 Aug 2023 11:44:53 +0200 (CEST) Date: Fri, 4 Aug 2023 11:44:53 +0200 From: Alvaro Herrera To: Dave Cramer Cc: Tatsuo Ishii , pgsql-hackers@lists.postgresql.org, nathandbossart@gmail.com Subject: Re: Using defines for protocol characters Message-ID: <20230804094453.kobqc52uxq72cqyc@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: > New patch attached which uses PREPARED_SUB_COMMAND and > PORTAL_SUB_COMMAND instead Hmm, I would keep the prefix in this case and make the message type a second prefix, with the subtype last -- PQMSG_CLOSE_PREPARED, PQMSG_DESCRIBE_PORTAL and so on. You define PASSWORD and GSS both with 'p', which I think is bogus; in some place that isn't doing GSS, you've replaced 'p' with the GSS one (CheckSASLAuth). I think it'd be better to give 'p' a single name, and not try to distinguish which is PASSWORD and which is GSS, because ultimately it's not important. There are some unpatched places, such as basebackup_copy.c -- there are several matches for /'.'/ that correspond to protocol chars in that file. Also CopySendEndOfRow has one 'd', and desc.c has two 'C'. I think fe-trace.c will require further adjustment of the comments for each function. We could change them to be the symbol for each char, like so: /* PQMSG_RESP_READY_FOR_QUERY */ static void pqTraceOutputZ(FILE *f, const char *message, int *cursor) Thanks -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Someone said that it is at least an order of magnitude more work to do production software than a prototype. I think he is wrong by at least an order of magnitude." (Brian Kernighan)