mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +00:00
postgres - show system databases when using separate schemas
This commit is contained in:
@@ -59,7 +59,7 @@ class Analyser extends DatabaseAnalyser {
|
||||
const query = super.createQuery(sql[resFileName], typeFields, replacements);
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
async _computeSingleObjectId() {
|
||||
const { typeField, schemaName, pureName } = this.singleObjectFilter;
|
||||
this.singleObjectId = `${typeField}:${schemaName || 'public'}.${pureName}`;
|
||||
@@ -364,6 +364,10 @@ class Analyser extends DatabaseAnalyser {
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
getDefaultSchemaNameCondition() {
|
||||
return `not in ('pg_catalog', 'pg_toast', 'information_schema')`;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Analyser;
|
||||
|
||||
@@ -11,10 +11,7 @@ select
|
||||
column_default as "default_value"
|
||||
from information_schema.columns
|
||||
where
|
||||
table_schema <> 'information_schema'
|
||||
and table_schema <> 'pg_catalog'
|
||||
and table_schema !~ '^pg_toast'
|
||||
and table_schema !~ '^_timescaledb_'
|
||||
table_schema !~ '^_timescaledb_'
|
||||
and (
|
||||
('tables:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
||||
or
|
||||
|
||||
@@ -8,10 +8,7 @@ select
|
||||
from information_schema.table_constraints
|
||||
inner join information_schema.key_column_usage on table_constraints.table_name = key_column_usage.table_name and table_constraints.constraint_name = key_column_usage.constraint_name
|
||||
where
|
||||
table_constraints.table_schema <> 'information_schema'
|
||||
and table_constraints.table_schema <> 'pg_catalog'
|
||||
and table_constraints.table_schema !~ '^pg_toast'
|
||||
and table_constraints.table_schema !~ '^_timescaledb_'
|
||||
table_constraints.table_schema !~ '^_timescaledb_'
|
||||
and table_constraints.constraint_type = 'PRIMARY KEY'
|
||||
and ('tables:' || table_constraints.table_schema || '.' || table_constraints.table_name) =OBJECT_ID_CONDITION
|
||||
and table_constraints.table_schema =SCHEMA_NAME_CONDITION
|
||||
|
||||
@@ -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' and routine_schema !~ '^_timescaledb_'
|
||||
information_schema.routines where routine_schema !~ '^_timescaledb_'
|
||||
and routine_type in ('PROCEDURE', 'FUNCTION') and routine_schema =SCHEMA_NAME_CONDITION
|
||||
`;
|
||||
|
||||
@@ -8,7 +8,7 @@ select
|
||||
$typeAggFunc(data_type $typeAggParam) as "data_type",
|
||||
max(external_language) as "language"
|
||||
from
|
||||
information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog' and routine_schema !~ '^_timescaledb_'
|
||||
information_schema.routines where routine_schema !~ '^_timescaledb_'
|
||||
and routine_schema =SCHEMA_NAME_CONDITION
|
||||
and (
|
||||
(routine_type = 'PROCEDURE' and ('procedures:' || routine_schema || '.' || routine_name) =OBJECT_ID_CONDITION)
|
||||
|
||||
@@ -3,10 +3,7 @@ select infoTables.table_schema as "schema_name", infoTables.table_name as "pure_
|
||||
from information_schema.tables infoTables
|
||||
where infoTables.table_type not like '%VIEW%'
|
||||
and ('tables:' || infoTables.table_schema || '.' || infoTables.table_name) =OBJECT_ID_CONDITION
|
||||
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_'
|
||||
and infoTables.table_schema =SCHEMA_NAME_CONDITION
|
||||
`;
|
||||
|
||||
@@ -21,10 +21,7 @@ select infoTables.table_schema as "schema_name", infoTables.table_name as "pure_
|
||||
from information_schema.tables infoTables
|
||||
where infoTables.table_type not like '%VIEW%'
|
||||
and ('tables:' || infoTables.table_schema || '.' || infoTables.table_name) =OBJECT_ID_CONDITION
|
||||
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_'
|
||||
and infoTables.table_schema =SCHEMA_NAME_CONDITION
|
||||
`;
|
||||
|
||||
@@ -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' and table_schema !~ '^_timescaledb_' and table_schema =SCHEMA_NAME_CONDITION
|
||||
where table_schema !~ '^_timescaledb_' and table_schema =SCHEMA_NAME_CONDITION
|
||||
and ('views:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user