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 1uZhRy-006q4j-Jh for pgpool-general@arkaria.postgresql.org; Thu, 10 Jul 2025 02:55:54 +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 1uZhRu-006vqQ-FR for pgpool-general@arkaria.postgresql.org; Thu, 10 Jul 2025 02:55:51 +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 1uZhRu-006vqJ-4W for pgpool-general@lists.postgresql.org; Thu, 10 Jul 2025 02:55:50 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZhRs-006lao-0f for pgpool-general@lists.postgresql.org; Thu, 10 Jul 2025 02:55:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=uwn6n5oSnzYm858SElEt5nNblERRi+xL4AZSXnZ6zeI=; b=hIFQxdsG6iVBGdV5UtG3aL6K8L 9xDwsOd46v+xSUfFe9ifZU4YYLMkqsdlexmOStM6AfbN6z9FQEQswSlMZtuq4L9NP5evY+CO5fn8K 8VH41DV2NiT/d9ug9nXG9Ulj+9JePM5N2Oh7TkJDUzlFb8pACltN1UaE/zyqIavJ/2HxFZ+vyq2AO q3YLlOVqBsehRGQFXpyo77OwM1wE3nrsPcqz9MkWWzWcTna7/wfCUgVcO/YUf6DfaRSWpaJ50L3tQ 1QdW4zWRzhCAU9KA/4bEdGhC0l5t0o36ZBRaejblQyNQ/QeUrdPZGTt/cNEG/a+pyyIlE/jLENlAW Tn89qxrQ==; Received: from [2409:11:4120:300:2d38:8392:5a4b:2812] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1uZhRo-007kQs-19; Thu, 10 Jul 2025 02:55:47 +0000 Date: Thu, 10 Jul 2025 11:55:35 +0900 (JST) Message-Id: <20250710.115535.1767264216072187810.ishii@postgresql.org> To: emond.papegaaij@gmail.com Cc: pgpool-general@lists.postgresql.org Subject: Re: FATAL: simple query "BEGIN" arrived before ending an extended query message From: Tatsuo Ishii In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:2d38:8392:5a4b:2812 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Hi all, > > Recently we started seeing errors from pgpool-II stating 'FATAL: simple > query "BEGIN" arrived before ending an extended query message'. These > errors started occurring after upgrading PgJDBC from 42.7.5 to 42.7.7. I've > created the following ticket at PgJDBC: > https://github.com/pgjdbc/pgjdbc/issues/3724 . It was closed as a duplicate > of https://github.com/pgjdbc/pgjdbc/issues/3107 , which describes a similar > issue and was opened by Tatsuo Ishii. > > The problem however, is that previously the error was only triggered when > using autosave, which is not a common setup, but now the error is triggered > even when using default configuration. This makes it impossible to combine > PgJDBC 42.7.6 and up with pgpool-II. I do not know what the plans are on > this from the side of PostgreSQL and PgJDBC, but I just wanted to raise > some awareness on this issue here. IMHO PostgreSQL should either explicitly > allow this (in which case pgpool-II needs to be fixed) or explicitly > disallow it (in which case PgJDBC needs to be fixed). As far as I know about PostgreSQL's side, Tom Lane said about this: https://www.postgresql.org/message-id/2069511.1706571615@sss.pgh.pa.us > 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. In my understanding he does not say PostgreSQL explicitely allows this (mixing extended and simple protocol message). > The current situation > is no good as we now simply cannot upgrade PgJDBC anymore (and the same > will be true for all other users of pgpool-II). Yeah. What I don't understand is, why PgJDBC decided to make it default (sending simple protocol query after extended query protocl without sync) even without autosave being set when they update PgJDBC to 42.7.7. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp