1 -- Tests with extended query protocol
2 SET pg_stat_statements.track_utility = FALSE;
3 -- This test checks that an execute message sets a query ID.
4 SELECT query_id IS NOT NULL AS query_id_set
5 FROM pg_stat_activity WHERE pid = pg_backend_pid() \bind \g
11 SELECT pg_stat_statements_reset() IS NOT NULL AS t;
17 SELECT $1 \parse stmt1
18 SELECT $1, $2 \parse stmt2
19 SELECT $1, $2, $3 \parse stmt3
20 SELECT $1 \bind 'unnamed_val1' \g
26 \bind_named stmt1 'stmt1_val1' \g
32 \bind_named stmt2 'stmt2_val1' 'stmt2_val2' \g
34 ------------+------------
35 stmt2_val1 | stmt2_val2
38 \bind_named stmt3 'stmt3_val1' 'stmt3_val2' 'stmt3_val3' \g
39 ?column? | ?column? | ?column?
40 ------------+------------+------------
41 stmt3_val1 | stmt3_val2 | stmt3_val3
44 \bind_named stmt3 'stmt3_val4' 'stmt3_val5' 'stmt3_val6' \g
45 ?column? | ?column? | ?column?
46 ------------+------------+------------
47 stmt3_val4 | stmt3_val5 | stmt3_val6
50 \bind_named stmt2 'stmt2_val3' 'stmt2_val4' \g
52 ------------+------------
53 stmt2_val3 | stmt2_val4
56 \bind_named stmt1 'stmt1_val1' \g
62 SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
64 -------+------+----------------------------------------------------
67 2 | 2 | SELECT $1, $2, $3
68 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t