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 1rUbEj-00BtSP-0t for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 23:40:21 +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 1rUbEh-001MhB-WF for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 23:40:20 +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 1rUbEh-001Mh0-Md for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 23:40:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rUbEf-00439Y-6L for pgsql-hackers@postgresql.org; Mon, 29 Jan 2024 23:40:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 40TNeF1B2069512; Mon, 29 Jan 2024 18:40:16 -0500 From: Tom Lane To: Tatsuo Ishii cc: pgsql-hackers@postgresql.org Subject: Re: When extended query protocol ends? In-reply-to: <20240130.082257.800729082723903188.t-ishii@sranhm.sra.co.jp> References: <20240130.082257.800729082723903188.t-ishii@sranhm.sra.co.jp> Comments: In-reply-to Tatsuo Ishii message dated "Tue, 30 Jan 2024 08:22:57 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2069510.1706571615.1@sss.pgh.pa.us> Date: Mon, 29 Jan 2024 18:40:15 -0500 Message-ID: <2069511.1706571615@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tatsuo Ishii writes: > Below is outputs from "pgproto" command coming with Pgpool-II. > (Lines starting "FE" represents a message from frontend to backend. > Lines starting "BE" represents a message from backend to frontend.) > FE=> Parse(stmt="", query="SET extra_float_digits = 3") > FE=> Bind(stmt="", portal="") > FE=> Execute(portal="") > FE=> Parse(stmt="", query="SET extra_float_digits = 3") > FE=> Bind(stmt="", portal="") > FE=> Execute(portal="") > FE=> Query (query="SET extra_float_digits = 3") > <= BE ParseComplete > <= BE BindComplete > <= BE CommandComplete(SET) > <= BE ParseComplete > <= BE BindComplete > <= BE CommandComplete(SET) > <= BE CommandComplete(SET) > <= BE ReadyForQuery(I) > FE=> Terminate > As you can see, two "SET extra_float_digits = 3" is sent in the > extended query protocol, then one "SET extra_float_digits = 3" follows > in the simple query protocol. No sync message is sent. However, I get > ReadyForQuery at the end. It seems the extended query protocol is > ended by a simple query protocol message instead of a sync message. > My question is, is this legal in terms of fronted/backend protocol? I think it's poor practice, at best. You should end the extended-protocol query cycle before invoking simple query. I'm disinclined to document, or make any promises about, what happens if you mix the protocols. regards, tom lane