From 108bc0504225e9ff7938fe1431150eb2bea1bd2f Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 16 Oct 2023 21:22:54 -0400 Subject: [PATCH] pg func discovery ignore sys schemas (#946) * Blessing results should destroy test db * ignore `pg_catalog` and `information_schema` schemas during functions autodiscovery --- justfile | 2 +- martin/src/pg/scripts/query_available_function.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 9f7d8d10..2a78b495 100644 --- a/justfile +++ b/justfile @@ -138,7 +138,7 @@ test-int: clean-test install-sqlx fi # Run integration tests and save its output as the new expected output -bless: start clean-test bless-insta +bless: restart clean-test bless-insta rm -rf tests/temp cargo test -p martin --features bless-tests tests/test.sh diff --git a/martin/src/pg/scripts/query_available_function.sql b/martin/src/pg/scripts/query_available_function.sql index 00d65bf5..baedff97 100755 --- a/martin/src/pg/scripts/query_available_function.sql +++ b/martin/src/pg/scripts/query_available_function.sql @@ -23,6 +23,7 @@ WITH jsonb_agg(data_type::text ORDER BY ordinal_position) as input_types FROM information_schema.parameters WHERE parameter_mode = 'IN' + AND specific_schema NOT IN ('pg_catalog', 'information_schema') GROUP BY specific_name), -- outputs AS ( @@ -32,6 +33,7 @@ WITH jsonb_agg(parameter_name::text ORDER BY ordinal_position) as out_names FROM information_schema.parameters WHERE parameter_mode = 'OUT' + AND specific_schema NOT IN ('pg_catalog', 'information_schema') GROUP BY specific_name), -- comments AS (