fixed load postgres schema on Azure #906

This commit is contained in:
SPRINX0\prochazka
2024-10-01 16:36:26 +02:00
parent 67f58a8dfe
commit 9d8dd558e2
10 changed files with 24 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ module.exports = `
select
matviewname as "pure_name",
schemaname as "schema_name",
md5(definition) as "hash_code"
$md5Function(definition) as "hash_code"
from
pg_catalog.pg_matviews WHERE schemaname NOT LIKE 'pg_%' AND schemaname =SCHEMA_NAME_CONDITION
`;

View File

@@ -3,7 +3,7 @@ select
matviewname as "pure_name",
schemaname as "schema_name",
definition as "definition",
md5(definition) as "hash_code"
$md5Function(definition) as "hash_code"
from
pg_catalog.pg_matviews WHERE schemaname NOT LIKE 'pg_%'
and ('matviews:' || schemaname || '.' || matviewname) =OBJECT_ID_CONDITION

View File

@@ -2,7 +2,7 @@ module.exports = `
select
routine_name as "pure_name",
routine_schema as "schema_name",
md5(routine_definition) as "hash_code",
$md5Function(routine_definition) as "hash_code",
routine_type as "object_type"
from
information_schema.routines where routine_schema !~ '^_timescaledb_'

View File

@@ -3,7 +3,7 @@ select
routine_name as "pure_name",
routine_schema as "schema_name",
max(routine_definition) as "definition",
max(md5(routine_definition)) as "hash_code",
max($md5Function(routine_definition)) as "hash_code",
routine_type as "object_type",
$typeAggFunc(data_type $typeAggParam) as "data_type",
max(external_language) as "language"

View File

@@ -1,7 +1,7 @@
module.exports = `
select infoTables.table_schema as "schema_name", infoTables.table_name as "pure_name",
(
select md5(string_agg(
select $md5Function(string_agg(
infoColumns.column_name || '|' || infoColumns.data_type || '|' || infoColumns.is_nullable::varchar(255) || '|' || coalesce(infoColumns.character_maximum_length, -1)::varchar(255)
|| '|' || coalesce(infoColumns.numeric_precision, -1)::varchar(255) ,
',' order by infoColumns.ordinal_position
@@ -10,7 +10,7 @@ select infoTables.table_schema as "schema_name", infoTables.table_name as "pure_
where infoColumns.table_schema = infoTables.table_schema and infoColumns.table_name = infoTables.table_name
),
(
select md5(string_agg(
select $md5Function(string_agg(
infoConstraints.constraint_name || '|' || infoConstraints.constraint_type ,
',' order by infoConstraints.constraint_name
)) as "hash_code_constraints"

View File

@@ -2,7 +2,7 @@ module.exports = `
select
table_name as "pure_name",
table_schema as "schema_name",
md5(view_definition) as "hash_code"
$md5Function(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
`;

View File

@@ -3,7 +3,7 @@ select
table_name as "pure_name",
table_schema as "schema_name",
view_definition as "create_sql",
md5(view_definition) as "hash_code"
$md5Function(view_definition) as "hash_code"
from
information_schema.views
where table_schema !~ '^_timescaledb_' and table_schema =SCHEMA_NAME_CONDITION