Prevent FATAL error when non-existing prepared statement is given.
authorTatsuo Ishii <ishii@postgresql.org>
Fri, 3 Oct 2025 01:18:45 +0000 (10:18 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Fri, 3 Oct 2025 01:18:45 +0000 (10:18 +0900)
commit12b5c2b100c019e91207b8169490552487e3c66d
tree73ea517f859b9f5d39724bdc37077dcdbd7e34b0
parent614ff72af5fe4e0b8b4999577c95871a8ad1d18a
Prevent FATAL error when non-existing prepared statement is given.

Previously Bind() raised FATAL error if non-existing prepared statement was given.
This is different from PostgreSQL's behavior.

\bind_named stmt2 'baz' \g
ERROR:  prepared statement "stmt2" does not exist

This commit let Bind() check the existence of prepared statement and
if it does not exist, send an ERROR message to frontend. Note that no
log is left in the log file. This is not preferred action but currently
it's not possible to leave log.

Backpatch-through: v4.2
src/protocol/pool_proto_modules.c