pg.ddx.io  pgpool-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
6+ messages / 1 participants
[nested] [flat]

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:57  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:57 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
V4_3_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=72251a2f032efa484b1d1ae7e07adf3b5e5ff...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/085.describe_bugs/expected.txt           | 10 ++++++
.../tests/085.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/085.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:57  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:57 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
V4_4_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=4e05d274b928a81ecb08c2fef01b5f83188c8...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/085.describe_bugs/expected.txt           | 10 ++++++
.../tests/085.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/085.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:57  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:57 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
V4_5_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=7807bbe5a49f247d3fec6c1b64849ffcd008b...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/085.describe_bugs/expected.txt           | 10 ++++++
.../tests/085.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/085.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:57  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:57 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
V4_6_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=d2a51d05c5443424b369f585c8926aa8d4bb1...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/085.describe_bugs/expected.txt           | 10 ++++++
.../tests/085.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/085.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:57  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:57 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )
<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
V4_7_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=bf52df3b660a7f377ee46d4537af70205dd17...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/135.describe_bugs/expected.txt           | 10 ++++++
.../tests/135.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/135.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar
@ 2026-11-14 00:58  Tatsuo Ishii <ishii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tatsuo Ishii @ 2026-11-14 00:58 UTC (permalink / raw)
  To: pgpool-committers@lists.postgresql.org

Fix Describe to not raise a FATAL error with nonexistent prepared statement.

Previously Describe() threw a FATAL error (and disconnected the
session) if nonexistent prepared statement is provided. This is an
incompatible behavior with PostgreSQL since it returns an ERROR
response and clients can continue the session in this case.

To fix this, create a dummy query context so that the Describe message
is sent to the primary node and an error response is returned from
PostgreSQL. Note that create_dummy_query_context() creates a query
context for a write query.

Below is the minimum test data for pgproto.

'D'     'S'     "missing_prepared"
'S'
'Y'
'Q'     "SELECT 1"
'Y'
'X'

And expected response. The session is killed anymore and following
simple query returns rows on the same session.

FE=> Describe(stmt="missing_prepared")
FE=> Sync
<= BE ErrorResponse(S ERROR V ERROR C 26000 M prepared statement "missing_prepared" does not exist F prepare.c L 451 R FetchPreparedStatement )
<= BE ReadyForQuery(I)
FE=> Query (query="SELECT 1")
<= BE RowDescription
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(I)
FE=> Terminate

Also a regression test case for this is added.

Reported-by: apkipa
Author: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://github.com/pgpool/pgpool2/issues/169
Backpatch-through: v4.3

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=b2440bdc75521fca2b2a81de067669fc7fd26...

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 18 ++++++----
.../tests/135.describe_bugs/expected.txt           | 10 ++++++
.../tests/135.describe_bugs/pgproto.data           |  7 ++++
.../regression/tests/135.describe_bugs/test.sh     | 41 ++++++++++++++++++++++
4 files changed, 69 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-14 00:58 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14 00:57 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>
2026-11-14 00:57 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>
2026-11-14 00:57 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>
2026-11-14 00:57 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>
2026-11-14 00:57 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>
2026-11-14 00:58 pgpool: Fix Describe to not raise a FATAL error with nonexistent prepar Tatsuo Ishii <ishii@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox