mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
#839 filter out timescaledb internal objects
This commit is contained in:
parent
315c0670d0
commit
97753e2b11
@ -14,6 +14,7 @@ where
|
|||||||
table_schema <> 'information_schema'
|
table_schema <> 'information_schema'
|
||||||
and table_schema <> 'pg_catalog'
|
and table_schema <> 'pg_catalog'
|
||||||
and table_schema !~ '^pg_toast'
|
and table_schema !~ '^pg_toast'
|
||||||
|
and table_schema !~ '^_timescaledb_'
|
||||||
and (
|
and (
|
||||||
('tables:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
('tables:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
||||||
or
|
or
|
||||||
|
@ -5,6 +5,6 @@ select
|
|||||||
md5(routine_definition) as "hash_code",
|
md5(routine_definition) as "hash_code",
|
||||||
routine_type as "object_type"
|
routine_type as "object_type"
|
||||||
from
|
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')
|
and routine_type in ('PROCEDURE', 'FUNCTION')
|
||||||
`;
|
`;
|
||||||
|
@ -2,16 +2,17 @@ module.exports = `
|
|||||||
select
|
select
|
||||||
routine_name as "pure_name",
|
routine_name as "pure_name",
|
||||||
routine_schema as "schema_name",
|
routine_schema as "schema_name",
|
||||||
routine_definition as "definition",
|
max(routine_definition) as "definition",
|
||||||
md5(routine_definition) as "hash_code",
|
max(md5(routine_definition)) as "hash_code",
|
||||||
routine_type as "object_type",
|
routine_type as "object_type",
|
||||||
data_type as "data_type",
|
string_agg(data_type, '|') as "data_type",
|
||||||
external_language as "language"
|
max(external_language) as "language"
|
||||||
from
|
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 (
|
and (
|
||||||
(routine_type = 'PROCEDURE' and ('procedures:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION)
|
(routine_type = 'PROCEDURE' and ('procedures:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION)
|
||||||
or
|
or
|
||||||
(routine_type = 'FUNCTION' and ('functions:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION)
|
(routine_type = 'FUNCTION' and ('functions:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION)
|
||||||
)
|
)
|
||||||
|
group by routine_name, routine_schema, routine_type
|
||||||
`;
|
`;
|
||||||
|
@ -7,4 +7,5 @@ and infoTables.table_schema <> 'pg_catalog'
|
|||||||
and infoTables.table_schema <> 'information_schema'
|
and infoTables.table_schema <> 'information_schema'
|
||||||
and infoTables.table_schema <> 'pg_internal'
|
and infoTables.table_schema <> 'pg_internal'
|
||||||
and infoTables.table_schema !~ '^pg_toast'
|
and infoTables.table_schema !~ '^pg_toast'
|
||||||
|
and infoTables.table_schema !~ '^_timescaledb_'
|
||||||
`;
|
`;
|
||||||
|
@ -25,4 +25,5 @@ and infoTables.table_schema <> 'pg_catalog'
|
|||||||
and infoTables.table_schema <> 'information_schema'
|
and infoTables.table_schema <> 'information_schema'
|
||||||
and infoTables.table_schema <> 'pg_internal'
|
and infoTables.table_schema <> 'pg_internal'
|
||||||
and infoTables.table_schema !~ '^pg_toast'
|
and infoTables.table_schema !~ '^pg_toast'
|
||||||
|
and infoTables.table_schema !~ '^_timescaledb_'
|
||||||
`;
|
`;
|
||||||
|
@ -4,5 +4,5 @@ select
|
|||||||
table_schema as "schema_name",
|
table_schema as "schema_name",
|
||||||
md5(view_definition) as "hash_code"
|
md5(view_definition) as "hash_code"
|
||||||
from
|
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_'
|
||||||
`;
|
`;
|
||||||
|
@ -6,6 +6,6 @@ select
|
|||||||
md5(view_definition) as "hash_code"
|
md5(view_definition) as "hash_code"
|
||||||
from
|
from
|
||||||
information_schema.views
|
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
|
and ('views:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
||||||
`;
|
`;
|
||||||
|
Loading…
Reference in New Issue
Block a user