Skip to content

Commit 4290c4b

Browse files
authored
Merge branch 'babelfish-for-postgresql:BABEL_5_X_DEV' into test_sql
2 parents cff1d7f + 0ede83d commit 4290c4b

File tree

8 files changed

+442
-3
lines changed

8 files changed

+442
-3
lines changed

contrib/babelfishpg_tsql/sql/sys_views.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,9 @@ c.contype = 'c' and c.conrelid != 0;
12931293
GRANT SELECT ON sys.check_constraints TO PUBLIC;
12941294

12951295
create or replace view sys.all_objects as
1296+
WITH tt_internal AS MATERIALIZED (
1297+
SELECT typrelid FROM sys.table_types_internal
1298+
)
12961299
select
12971300
name collate sys.database_default
12981301
, cast (object_id as integer)
@@ -1327,7 +1330,7 @@ select
13271330
, 0 as is_published
13281331
, 0 as is_schema_published
13291332
from pg_class t inner join pg_namespace s on s.oid = t.relnamespace
1330-
left join sys.table_types_internal tt on t.oid = tt.typrelid
1333+
left join tt_internal tt on t.oid = tt.typrelid
13311334
left join sys.babelfish_namespace_ext ext on (s.nspname = ext.nspname and ext.dbid = sys.db_id())
13321335
left join sys.shipped_objects_not_in_sys nis on nis.name = t.relname and nis.schemaid = s.oid and nis.type = 'U'
13331336
where t.relpersistence in ('p', 'u', 't')
@@ -1352,7 +1355,7 @@ select
13521355
, 0 as is_published
13531356
, 0 as is_schema_published
13541357
from pg_class t inner join pg_namespace s on s.oid = t.relnamespace
1355-
left join sys.table_types_internal tt on t.oid = tt.typrelid
1358+
left join tt_internal tt on t.oid = tt.typrelid
13561359
left join sys.babelfish_namespace_ext ext on (s.nspname = ext.nspname and ext.dbid = sys.db_id())
13571360
left join sys.shipped_objects_not_in_sys nis on nis.name = t.relname and nis.schemaid = s.oid and nis.type = 'U'
13581361
where t.relpersistence in ('p', 'u', 't')

0 commit comments

Comments
 (0)