Re: FATAL: simple query "BEGIN" arrived before ending an extended query message

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: emond(dot)papegaaij(at)gmail(dot)com
Cc: pgpool-general(at)lists(dot)postgresql(dot)org
Subject: Re: FATAL: simple query "BEGIN" arrived before ending an extended query message
Date: 2025-07-10 02:55:35
Message-ID: 20250710.115535.1767264216072187810.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

> 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

In response to

Responses

Browse pgpool-general by date

  From Date Subject
Next Message Emond Papegaaij 2025-07-10 06:34:53 Re: FATAL: simple query "BEGIN" arrived before ending an extended query message
Previous Message Emond Papegaaij 2025-07-09 11:13:26 FATAL: simple query "BEGIN" arrived before ending an extended query message