\set ECHO 0
\set QUIET 1
BEGIN;
\pset format unaligned
\t
SET IntervalStyle = 'postgres';
\i sql/explanation.sql
SELECT pg_typeof(planned_at) = 'timestamptz'::regtype, 'planned_at' frOM explanation('SELECT 1');
SELECT pg_typeof(node_id) = 'text'::regtype, 'node_id' FROM parse_node('Aggregate');
SELECT pg_typeof(parent_id) = 'text'::regtype, 'parent_id' FROM parse_node('Aggregate');
SELECT pg_typeof(node_type) = 'text'::regtype, 'node_type' FROM parse_node('Aggregate');
SELECT pg_typeof(total_runtime) = 'interval'::regtype,'total_runtime' FROM parse_node('Aggregate'::xml, NULL, '12.2 ms');
SELECT pg_typeof(strategy) = 'text'::regtype, 'strategy' FROM parse_node('Sorted');
SELECT pg_typeof(operation) = 'text'::regtype, 'operation' FROM parse_node('foo');
SELECT pg_typeof(startup_cost) = 'float'::regtype, 'startup_cost' FROM parse_node('258.13');
SELECT pg_typeof(total_cost) = 'float'::regtype, 'total_cost' FROM parse_node('259.13');
SELECT pg_typeof(plan_rows) = 'float'::regtype, 'plan_rows' FROM parse_node('1000');
SELECT pg_typeof(plan_width) = 'integer'::regtype, 'plan_width' FROM parse_node('33');
SELECT pg_typeof(actual_startup_time) = 'interval'::regtype,'actual_startup_time' FROM parse_node('0.121');
SELECT pg_typeof(actual_total_time) = 'interval'::regtype,'actual_total_time' FROM parse_node('0.134');
SELECT pg_typeof(actual_rows) = 'float'::regtype, 'actual_rows' FROM parse_node('2000');
SELECT pg_typeof(actual_loops) = 'float'::regtype, 'actual_loops' FROM parse_node('20');
SELECT pg_typeof(parent_relationship) = 'text'::regtype, 'parent_relationship' FROM parse_node('Outer');
SELECT pg_typeof(sort_key) = 'text[]'::regtype, 'sort_key' FROM parse_node('- d.id
- d.name
');
SELECT pg_typeof(sort_method) = 'text[]'::regtype, 'sort_method' FROM parse_node('- this
- that
');
SELECT pg_typeof(sort_space_used) = 'bigint'::regtype, 'sort_space_used' FROM parse_node('3242');
SELECT pg_typeof(sort_space_type) = 'text'::regtype, 'sort_space_type' FROM parse_node('whatever');
SELECT pg_typeof(join_type) = 'text'::regtype, 'join_type' FROM parse_node('nested');
SELECT pg_typeof(join_filter) = 'text'::regtype, 'join_filter' FROM parse_node('pandering');
SELECT pg_typeof(hash_cond) = 'text'::regtype, 'hash_cond' FROM parse_node('(de.distribution = d.name)');
SELECT pg_typeof(relation_name) = 'text'::regtype, 'relation_name' FROM parse_node('users');
SELECT pg_typeof(alias) = 'text'::regtype, 'alias' FROM parse_node('u');
SELECT pg_typeof(scan_direction) = 'text'::regtype, 'scan_direction' FROM parse_node('forward');
SELECT pg_typeof(index_name) = 'text'::regtype, 'index_name' FROM parse_node('idx_users');
SELECT pg_typeof(index_cond) = 'text'::regtype, 'index_cond' FROM parse_node('(u.name = mumble)');
SELECT pg_typeof(recheck_cond) = 'text'::regtype, 'recheck_cond' FROM parse_node('(u.id = fumble)');
SELECT pg_typeof(tid_cond) = 'text'::regtype, 'tid_cond' FROM parse_node('(t.id = tid)');
SELECT pg_typeof(merge_cond) = 'text'::regtype, 'merge_cond' FROM parse_node('(m.id = mid)');
SELECT pg_typeof(subplan_name) = 'text'::regtype, 'subplan_name' FROM parse_node('my-subplan');
SELECT pg_typeof(function_name) = 'text'::regtype, 'function_name' FROM parse_node('parse_node()');
SELECT pg_typeof(function_call) = 'text'::regtype, 'function_call' FROM parse_node('parse_node(this, that)');
SELECT pg_typeof(filter) = 'text'::regtype, 'filter' FROM parse_node('x = y');
SELECT pg_typeof(one_time_filter) = 'text'::regtype, 'one_time_filter' FROM parse_node('one = two');
SELECT pg_typeof(command) = 'text'::regtype, 'command' FROM parse_node('go!');
SELECT pg_typeof(shared_hit_blocks) = 'bigint'::regtype, 'shared_hit_blocks' FROM parse_node('2000');
SELECT pg_typeof(shared_read_blocks) = 'bigint'::regtype, 'shared_read_blocks' FROM parse_node('20');
SELECT pg_typeof(shared_written_blocks) = 'bigint'::regtype, 'shared_written_blocks' FROM parse_node('0');
SELECT pg_typeof(local_hit_blocks) = 'bigint'::regtype, 'local_hit_blocks' FROM parse_node('3453');
SELECT pg_typeof(local_read_blocks) = 'bigint'::regtype, 'local_read_blocks' FROM parse_node('234');
SELECT pg_typeof(local_written_blocks) = 'bigint'::regtype, 'local_written_blocks' FROM parse_node('12');
SELECT pg_typeof(temp_read_blocks) = 'bigint'::regtype, 'temp_read_blocks' FROM parse_node('349394934934934');
SELECT pg_typeof(temp_written_blocks) = 'bigint'::regtype, 'temp_written_blocks' FROM parse_node('2323');
SELECT pg_typeof(output) = 'text[]'::regtype, 'output' FROM parse_node('');
SELECT pg_typeof(hash_buckets) = 'bigint'::regtype, 'hash_buckets' FROM parse_node('42');
SELECT pg_typeof(hash_batches) = 'bigint'::regtype, 'hash_batches' FROM parse_node('96');
SELECT pg_typeof(original_hash_batches) = 'bigint'::regtype, 'original_hash_batches' FROM parse_node('2');
SELECT pg_typeof(peak_memory_usage) = 'bigint'::regtype, 'peak_memory_usage' FROM parse_node('34234823482348');
SELECT pg_typeof(schema) = 'text'::regtype, 'schema' FROM parse_node('public');
SELECT pg_typeof(cte_name) = 'text'::regtype, 'cte_name' FROM parse_node('ralph');
SELECT pg_typeof(triggers) = 'trigger_plan[]'::regtype, 'triggers' FROM parse_node('ralph', NULL, NULL, ARRAY[ROW('Harry', 'Melissa', 'users', '00:00:00.000234', 14)::trigger_plan]);
ROLLBACK;