diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/columns.js b/plugins/dbgate-plugin-postgres/src/backend/sql/columns.js index 0be8a81d..32b0b16f 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/columns.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/columns.js @@ -14,6 +14,7 @@ where table_schema <> 'information_schema' and table_schema <> 'pg_catalog' and table_schema !~ '^pg_toast' + and table_schema !~ '^_timescaledb_' and ( ('tables:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION or diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/routineModifications.js b/plugins/dbgate-plugin-postgres/src/backend/sql/routineModifications.js index ad93e973..1eae4ca8 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/routineModifications.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/routineModifications.js @@ -5,6 +5,6 @@ select md5(routine_definition) as "hash_code", routine_type as "object_type" from - information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' + information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' and routine_schema !~ '^_timescaledb_' and routine_type in ('PROCEDURE', 'FUNCTION') `; diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/routines.js b/plugins/dbgate-plugin-postgres/src/backend/sql/routines.js index f136eeba..24e7aabc 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/routines.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/routines.js @@ -2,16 +2,17 @@ module.exports = ` select routine_name as "pure_name", routine_schema as "schema_name", - routine_definition as "definition", - md5(routine_definition) as "hash_code", + max(routine_definition) as "definition", + max(md5(routine_definition)) as "hash_code", routine_type as "object_type", - data_type as "data_type", - external_language as "language" + string_agg(data_type, '|') as "data_type", + max(external_language) as "language" from - information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' + information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' and routine_schema !~ '^_timescaledb_' and ( (routine_type = 'PROCEDURE' and ('procedures:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION) or (routine_type = 'FUNCTION' and ('functions:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION) ) + group by routine_name, routine_schema, routine_type `; diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/tableList.js b/plugins/dbgate-plugin-postgres/src/backend/sql/tableList.js index e416ed85..1e9f44db 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/tableList.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/tableList.js @@ -7,4 +7,5 @@ and infoTables.table_schema <> 'pg_catalog' and infoTables.table_schema <> 'information_schema' and infoTables.table_schema <> 'pg_internal' and infoTables.table_schema !~ '^pg_toast' +and infoTables.table_schema !~ '^_timescaledb_' `; diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/tableModifications.js b/plugins/dbgate-plugin-postgres/src/backend/sql/tableModifications.js index 700405da..1e074769 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/tableModifications.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/tableModifications.js @@ -25,4 +25,5 @@ and infoTables.table_schema <> 'pg_catalog' and infoTables.table_schema <> 'information_schema' and infoTables.table_schema <> 'pg_internal' and infoTables.table_schema !~ '^pg_toast' +and infoTables.table_schema !~ '^_timescaledb_' `; diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/viewModifications.js b/plugins/dbgate-plugin-postgres/src/backend/sql/viewModifications.js index 9a61358a..e344bbdd 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/viewModifications.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/viewModifications.js @@ -4,5 +4,5 @@ select table_schema as "schema_name", md5(view_definition) as "hash_code" from - information_schema.views where table_schema != 'information_schema' and table_schema != 'pg_catalog' + information_schema.views where table_schema != 'information_schema' and table_schema != 'pg_catalog' and table_schema !~ '^_timescaledb_' `; diff --git a/plugins/dbgate-plugin-postgres/src/backend/sql/views.js b/plugins/dbgate-plugin-postgres/src/backend/sql/views.js index aa25a0cf..a009f3ac 100644 --- a/plugins/dbgate-plugin-postgres/src/backend/sql/views.js +++ b/plugins/dbgate-plugin-postgres/src/backend/sql/views.js @@ -6,6 +6,6 @@ select md5(view_definition) as "hash_code" from information_schema.views -where table_schema != 'information_schema' and table_schema != 'pg_catalog' +where table_schema != 'information_schema' and table_schema != 'pg_catalog' and table_schema !~ '^_timescaledb_' and ('views:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION `;