From 7f9a30f568c3dccbd849f3ada0aed4f3a1f5be25 Mon Sep 17 00:00:00 2001 From: Nybkox Date: Thu, 28 Nov 2024 11:37:47 +0100 Subject: [PATCH] fix: add missing conditions for pssql parameters query --- .../src/backend/sql/proceduresParameters.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/proceduresParameters.js b/plugins/dbgate-plugin-postgres/src/backend/sql/proceduresParameters.js index c128d73f5..1e37d3f2a 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/proceduresParameters.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/proceduresParameters.js @@ -13,14 +13,21 @@ SELECT ELSE FALSE END AS is_output_parameter FROM - information_schema.routines proc + information_schema.routines proc LEFT JOIN information_schema.parameters args ON proc.specific_schema = args.specific_schema AND proc.specific_name = args.specific_name WHERE - proc.routine_schema NOT IN ('pg_catalog', 'information_schema') -- Exclude system schemas + proc.specific_schema NOT IN ('pg_catalog', 'information_schema') -- Exclude system schemas AND proc.routine_type IN ('PROCEDURE', 'FUNCTION') -- Filter for procedures + AND proc.specific_schema !~ '^_timescaledb_' + AND proc.specific_schema =SCHEMA_NAME_CONDITION + AND ( + (routine_type = 'PROCEDURE' AND ('procedures:' || proc.specific_schema || '.' || routine_name) =OBJECT_ID_CONDITION) + OR + (routine_type = 'FUNCTION' AND ('functions:' || proc.specific_schema || '.' || routine_name) =OBJECT_ID_CONDITION) + ) ORDER BY schema_name, parameter_name,