Fixed an issue where dependencies and dependents were not showing if a composite type is used as an attribute in another composite type. #7027

This commit is contained in:
Pravesh Sharma 2024-02-21 11:18:44 +05:30 committed by GitHub
parent d3ede3151a
commit 4faf2a3c6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -1527,8 +1527,11 @@ class TypeView(PGChildNodeView, DataTypeReader, SchemaDiffObjectCompare):
scid: Schema ID
tid: Type ID
"""
# For composite type typrelid is required to fetch dependencies.
type_where = "WHERE (dep.objid={0}::oid OR dep.objid=(select typrelid \
from pg_type where oid = {0}::oid))".format(tid)
dependencies_result = self.get_dependencies(
self.conn, tid
self.conn, tid, where=type_where
)
return ajax_response(

View File

@ -580,6 +580,7 @@ class PGChildNodeView(NodeView):
'Pf': 'function', 'Pt': 'trigger_function', 'Pp': 'procedure',
'Rl': 'rule', 'Rs': 'row_security_policy', 'Sy': 'synonym',
'Ty': 'type', 'Tr': 'trigger', 'Tc': 'compound_trigger',
'c': 'type',
# None specified special handling for this type
'A': None
}