-- Check multi statement query SET pg_tracing.sample_rate = 1.0; -- Test multiple statements in a single query /*dddbs='postgres.db',traceparent='00-0000000000000000000000000000000c-000000000000000c-01'*/ select 1; select 2; ?column? ---------- 1 (1 row) ?column? ---------- 2 (1 row) SELECT span_operation, parameters, lvl from peek_ordered_spans where trace_id='0000000000000000000000000000000c'; span_operation | parameters | lvl ----------------+------------+----- select $1 | {1} | 0 Planner | | 1 ExecutorRun | | 1 Result | | 2 (4 rows) CALL clean_spans(); -- Force a multi-query statement with \; SELECT 1\; SELECT 1, 2; ?column? ---------- 1 (1 row) ?column? | ?column? ----------+---------- 1 | 2 (1 row) SELECT span_type, span_operation, parameters, lvl from peek_ordered_spans; span_type | span_operation | parameters | lvl --------------+----------------+------------+----- Select query | SELECT $1 | {1} | 0 Planner | Planner | | 1 ExecutorRun | ExecutorRun | | 1 Result | Result | | 2 Select query | SELECT $1, $2 | {1,2} | 0 Planner | Planner | | 1 ExecutorRun | ExecutorRun | | 1 Result | Result | | 2 (8 rows) CALL clean_spans(); -- Cleanup CALL reset_settings();