Hi,
I reviewed and tested
v4-0001-Clean-up-PREPARE-query-strings-in-multi-statement.patch on the
current master branch.
The patch applied cleanly, PostgreSQL built successfully, and the
server started without any issues.
I tested the main functionality using multiple prepared statements:
PREPARE s1 AS SELECT 1;
PREPARE s2(text) AS SELECT oid FROM pg_class WHERE relname=$1;
PREPARE s3(int,int) AS SELECT $1+$2;
SELECT name, statement FROM pg_prepared_statements;
The output was:
name | statement
------+---------------------------------------------------------------
s1 | PREPARE s1 AS SELECT 1
s2 | PREPARE s2(text) AS SELECT oid FROM pg_class WHERE relname=$1
s3 | PREPARE s3(int,int) AS SELECT $1+$2
I then executed all three prepared statements:
EXECUTE s1;
EXECUTE s2('pg_class');
EXECUTE s3(10,20);
The results were as expected:
s1 -> 1
s2 -> 1259
s3 -> 30
I also checked error reporting with:
PREPARE stmt AS
SELECT nonexistent_column
FROM users;
The server reported:
ERROR: relation "users" does not exist
LINE 3: FROM users;
^
The error cursor pointed to the expected location, and I didn't
observe any regressions in the scenarios I tested.
I wasn't able to test the pg_stat_statements scenario because my local
setup has a version mismatch between the PostgreSQL 20devel server and
the installed pg_stat_statements library.
Overall, the patch applied cleanly and worked as expected in the
scenarios I tested.
Thanks for working on this patch.
Regards,
solai