Change icons for table inheritance (icons by Chethana Kumar) Fixes #3174
Along with this, I have also fixed few other issues/icons found on the way: 1) Dependencies tab for inherited tables/foreign keys shows partial text (Fixes ##3994). 2) Dependencies tab for child partition table shows parent partition table as Function. 3) Dependencies tab for triggers shows trigger functions as plain functions. 4) Dependents tab for partitioned table shows the child partition tables as normal table instead for partitioned tables.pull/24/head
parent
bf548dda3f
commit
402dfd07db
|
@ -9,10 +9,12 @@ This release contains a number of bug fixes and new features since the release o
|
||||||
New features
|
New features
|
||||||
************
|
************
|
||||||
|
|
||||||
|
| `Feature #3174 <https://redmine.postgresql.org/issues/3174>`_ - Visually distinguish simple tables from tables that are inherited and from which other tables are inherited.
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
| `Bug #3994 <https://redmine.postgresql.org/issues/3994>`_ - Fix issue where the dependencies tab for inherited tables/foreign keys shows partial text.
|
||||||
| `Bug #4171 <https://redmine.postgresql.org/issues/4171>`_ - Fix issue where reverse engineered SQL was failing for foreign tables, if it had "=" in the options.
|
| `Bug #4171 <https://redmine.postgresql.org/issues/4171>`_ - Fix issue where reverse engineered SQL was failing for foreign tables, if it had "=" in the options.
|
||||||
| `Bug #4195 <https://redmine.postgresql.org/issues/4195>`_ - Fix keyboard navigation in "inner" tabsets such as the Query Tool and Debugger.
|
| `Bug #4195 <https://redmine.postgresql.org/issues/4195>`_ - Fix keyboard navigation in "inner" tabsets such as the Query Tool and Debugger.
|
||||||
| `Bug #4228 <https://redmine.postgresql.org/issues/4228>`_ - Ensure the correct label is used in panel headers when viewing filtered rows.
|
| `Bug #4228 <https://redmine.postgresql.org/issues/4228>`_ - Ensure the correct label is used in panel headers when viewing filtered rows.
|
||||||
|
|
|
@ -74,6 +74,42 @@ class TableModule(SchemaChildModule):
|
||||||
"""
|
"""
|
||||||
return database.DatabaseModule.NODE_TYPE
|
return database.DatabaseModule.NODE_TYPE
|
||||||
|
|
||||||
|
@property
|
||||||
|
def csssnippets(self):
|
||||||
|
"""
|
||||||
|
Returns a snippet of css to include in the page
|
||||||
|
"""
|
||||||
|
snippets = [
|
||||||
|
render_template(
|
||||||
|
"browser/css/collection.css",
|
||||||
|
node_type=self.node_type,
|
||||||
|
),
|
||||||
|
render_template(
|
||||||
|
"browser/css/node.css",
|
||||||
|
node_type=self.node_type,
|
||||||
|
),
|
||||||
|
render_template(
|
||||||
|
"browser/css/node.css",
|
||||||
|
node_type='table',
|
||||||
|
file_name='table-inherited',
|
||||||
|
),
|
||||||
|
render_template(
|
||||||
|
"browser/css/node.css",
|
||||||
|
node_type='table',
|
||||||
|
file_name='table-inherits',
|
||||||
|
),
|
||||||
|
render_template(
|
||||||
|
"browser/css/node.css",
|
||||||
|
node_type='table',
|
||||||
|
file_name='table-multi-inherit',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
for submodule in self.submodules:
|
||||||
|
snippets.extend(submodule.csssnippets)
|
||||||
|
|
||||||
|
return snippets
|
||||||
|
|
||||||
def get_own_javascripts(self):
|
def get_own_javascripts(self):
|
||||||
scripts = SchemaChildModule.get_own_javascripts(self)
|
scripts = SchemaChildModule.get_own_javascripts(self)
|
||||||
|
|
||||||
|
@ -271,6 +307,28 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
|
||||||
status=200
|
status=200
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_icon_css_class(self, table_info, default_val='icon-table'):
|
||||||
|
if ('is_inherits' in table_info and
|
||||||
|
table_info['is_inherits'] == '1') or \
|
||||||
|
('coll_inherits' in table_info and
|
||||||
|
len(table_info['coll_inherits']) > 0):
|
||||||
|
|
||||||
|
if ('is_inherited' in table_info and
|
||||||
|
table_info['is_inherited'] == '1')\
|
||||||
|
or ('inherited_tables_cnt' in table_info and
|
||||||
|
len(table_info['inherited_tables_cnt']) > 0):
|
||||||
|
default_val = 'icon-table-multi-inherit'
|
||||||
|
else:
|
||||||
|
default_val = 'icon-table-inherits'
|
||||||
|
elif ('is_inherited' in table_info and
|
||||||
|
table_info['is_inherited'] == '1')\
|
||||||
|
or ('inherited_tables_cnt' in table_info and
|
||||||
|
len(table_info['inherited_tables_cnt']) > 0):
|
||||||
|
default_val = 'icon-table-inherited'
|
||||||
|
|
||||||
|
return super(TableView, self).\
|
||||||
|
get_icon_css_class(table_info, default_val)
|
||||||
|
|
||||||
@BaseTableView.check_precondition
|
@BaseTableView.check_precondition
|
||||||
def node(self, gid, sid, did, scid, tid):
|
def node(self, gid, sid, did, scid, tid):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -17,7 +17,7 @@ class BasePartitionTable:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_icon_css_class(self, table_info):
|
def get_icon_css_class(self, table_info, default_val='icon-table'):
|
||||||
if self.is_table_partitioned(table_info):
|
if self.is_table_partitioned(table_info):
|
||||||
return 'icon-partition'
|
return 'icon-partition'
|
||||||
return 'icon-table'
|
return default_val
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#c1cbd5;}.cls-3{fill:#2195e7;}.cls-4{fill:#34495e;}</style></defs><title>inherited</title><g id="_10" data-name="10"><rect class="cls-1" x="2.5" y="3" width="11" height="10" rx="1"/><polygon class="cls-2" points="13 9.13 8.38 9.13 8.38 6 7.63 6 7.63 9.13 3 9.13 3 9.88 7.63 9.88 7.63 13 8.38 13 8.38 9.88 13 9.88 13 9.13"/><path class="cls-3" d="M12.5,3h-9a1,1,0,0,0-1,1v8a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V4A1,1,0,0,0,12.5,3Zm0,.75a.25.25,0,0,1,.25.25V6.12H8.38V3.75Zm-9,0H7.62V6.12H3.25V4A.25.25,0,0,1,3.5,3.75Zm9,8.5h-9A.25.25,0,0,1,3.25,12V6.88h9.5V12A.25.25,0,0,1,12.5,12.25Z"/><path class="cls-1" d="M12,8a3.93,3.93,0,1,1,3.93-3.93A3.94,3.94,0,0,1,12,8Z"/><path class="cls-4" d="M12,.25a3.8,3.8,0,1,1-3.8,3.8A3.8,3.8,0,0,1,12,.25M12,0A4.05,4.05,0,1,0,16,4.05,4,4,0,0,0,12,0Z"/><path class="cls-4" d="M11.77,1.93a.54.54,0,0,0,0,.76l.82.82H10a.54.54,0,0,0,0,1.08h2.58l-.82.82a.54.54,0,1,0,.76.76l1.74-1.74a.53.53,0,0,0,0-.76L12.53,1.93A.54.54,0,0,0,11.77,1.93Z"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#c1cbd5;}.cls-3{fill:#2195e7;}.cls-4{fill:#34495e;}</style></defs><title>inherits</title><g id="_10" data-name="10"><rect class="cls-1" x="2.5" y="3" width="11" height="10" rx="1"/><polygon class="cls-2" points="13 9.13 8.38 9.13 8.38 6 7.63 6 7.63 9.13 3 9.13 3 9.88 7.63 9.88 7.63 13 8.38 13 8.38 9.88 13 9.88 13 9.13"/><path class="cls-3" d="M12.5,3h-9a1,1,0,0,0-1,1v8a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V4A1,1,0,0,0,12.5,3Zm0,.75a.25.25,0,0,1,.25.25V6.12H8.38V3.75Zm-9,0H7.62V6.12H3.25V4A.25.25,0,0,1,3.5,3.75Zm9,8.5h-9A.25.25,0,0,1,3.25,12V6.88h9.5V12A.25.25,0,0,1,12.5,12.25Z"/><path class="cls-1" d="M12,8a3.93,3.93,0,1,1,3.93-3.93A3.94,3.94,0,0,1,12,8Z"/><path class="cls-4" d="M12,.25a3.8,3.8,0,1,1-3.8,3.8A3.8,3.8,0,0,1,12,.25M12,0A4.05,4.05,0,1,0,16,4.05,4,4,0,0,0,12,0Z"/><path class="cls-4" d="M12.13,1.93a.54.54,0,0,1,0,.76l-.82.82h2.58a.54.54,0,0,1,0,1.08H11.31l.82.82a.54.54,0,1,1-.76.76L9.63,4.43a.53.53,0,0,1,0-.76l1.74-1.74A.54.54,0,0,1,12.13,1.93Z"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#c1cbd5;}.cls-3{fill:#2195e7;}.cls-4{fill:#34495e;}</style></defs><title>multiple</title><g id="_10" data-name="10"><rect class="cls-1" x="2.5" y="3" width="11" height="10" rx="1"/><polygon class="cls-2" points="13 9.13 8.38 9.13 8.38 6 7.63 6 7.63 9.13 3 9.13 3 9.88 7.63 9.88 7.63 13 8.38 13 8.38 9.88 13 9.88 13 9.13"/><path class="cls-3" d="M12.5,3h-9a1,1,0,0,0-1,1v8a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V4A1,1,0,0,0,12.5,3Zm0,.75a.25.25,0,0,1,.25.25V6.12H8.38V3.75Zm-9,0H7.62V6.12H3.25V4A.25.25,0,0,1,3.5,3.75Zm9,8.5h-9A.25.25,0,0,1,3.25,12V6.88h9.5V12A.25.25,0,0,1,12.5,12.25Z"/><path class="cls-1" d="M12,8a3.93,3.93,0,1,1,3.93-3.93A3.94,3.94,0,0,1,12,8Z"/><path class="cls-4" d="M12,.25a3.8,3.8,0,1,1-3.8,3.8A3.8,3.8,0,0,1,12,.25M12,0A4.05,4.05,0,1,0,16,4.05,4,4,0,0,0,12,0Z"/><path class="cls-4" d="M14.94,3.71,13.38,2.14a.49.49,0,0,0-.69.69l.73.73H10.48l.73-.73a.49.49,0,0,0-.69-.69L9,3.71a.48.48,0,0,0,0,.68L10.52,6a.49.49,0,1,0,.69-.69l-.73-.73h2.94l-.73.73a.49.49,0,1,0,.69.69l1.56-1.57a.48.48,0,0,0,0-.68Z"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -1,7 +1,9 @@
|
||||||
SELECT rel.oid, rel.relname AS name,
|
SELECT rel.oid, rel.relname AS name,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers,
|
||||||
(CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_partitioned
|
(CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_partitioned,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhrelid=rel.oid LIMIT 1) as is_inherits,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhparent=rel.oid LIMIT 1) as is_inherited
|
||||||
FROM pg_class rel
|
FROM pg_class rel
|
||||||
WHERE rel.relkind IN ('r','s','t','p') AND rel.relnamespace = {{ scid }}::oid
|
WHERE rel.relkind IN ('r','s','t','p') AND rel.relnamespace = {{ scid }}::oid
|
||||||
AND NOT rel.relispartition
|
AND NOT rel.relispartition
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
SELECT rel.oid, rel.relname AS name,
|
SELECT rel.oid, rel.relname AS name,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhrelid=rel.oid LIMIT 1) as is_inherits,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhparent=rel.oid LIMIT 1) as is_inherited
|
||||||
FROM pg_class rel
|
FROM pg_class rel
|
||||||
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
||||||
{% if tid %} AND rel.oid = {{tid}}::OID {% endif %}
|
{% if tid %} AND rel.oid = {{tid}}::OID {% endif %}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
SELECT rel.oid, rel.relname AS name,
|
SELECT rel.oid, rel.relname AS name,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhrelid=rel.oid LIMIT 1) as is_inherits,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhparent=rel.oid LIMIT 1) as is_inherited
|
||||||
FROM pg_class rel
|
FROM pg_class rel
|
||||||
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
||||||
{% if tid %} AND rel.oid = {{tid}}::OID {% endif %}
|
{% if tid %} AND rel.oid = {{tid}}::OID {% endif %}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
SELECT rel.oid, rel.relname AS name,
|
SELECT rel.oid, rel.relname AS name,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
|
||||||
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers,
|
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers,
|
||||||
(CASE WHEN (SELECT count(*) from pg_partition where parrelid = rel.oid) > 0 THEN true ELSE false END) AS is_partitioned
|
(CASE WHEN (SELECT count(*) from pg_partition where parrelid = rel.oid) > 0 THEN true ELSE false END) AS is_partitioned,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhrelid=rel.oid LIMIT 1) as is_inherits,
|
||||||
|
(SELECT count(1) FROM pg_inherits WHERE inhparent=rel.oid LIMIT 1) as is_inherited
|
||||||
FROM pg_class rel
|
FROM pg_class rel
|
||||||
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
|
||||||
AND rel.relname NOT IN (SELECT partitiontablename FROM pg_partitions)
|
AND rel.relname NOT IN (SELECT partitiontablename FROM pg_partitions)
|
||||||
|
|
|
@ -4,7 +4,8 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, pg_get_expr(a
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -14,10 +15,12 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, pg_get_expr(a
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
||||||
|
@ -38,6 +41,9 @@ LEFT JOIN pg_namespace ns ON dep.refobjid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
||||||
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.refobjid
|
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.refobjid
|
||||||
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.refobjid
|
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.refobjid
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.refobjid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.refobjid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
|
|
|
@ -3,7 +3,8 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, pg_get_expr(ad.a
|
||||||
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
||||||
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -13,10 +14,12 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, pg_get_expr(ad.a
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
||||||
|
@ -37,6 +40,9 @@ LEFT JOIN pg_namespace ns ON dep.objid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
||||||
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.objid
|
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.objid
|
||||||
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.objid
|
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.objid
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.objid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.objid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
|
|
|
@ -4,7 +4,8 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -14,10 +15,12 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
||||||
|
@ -38,8 +41,11 @@ LEFT JOIN pg_namespace ns ON dep.refobjid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
||||||
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.refobjid
|
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.refobjid
|
||||||
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.refobjid
|
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.refobjid
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.refobjid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.refobjid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
'pg_trigger', 'pg_type', 'pg_attrdef', 'pg_event_trigger', 'pg_foreign_server', 'pg_foreign_data_wrapper'))
|
'pg_trigger', 'pg_type', 'pg_attrdef', 'pg_event_trigger', 'pg_foreign_server', 'pg_foreign_data_wrapper'))
|
||||||
ORDER BY refclassid, cl.relkind
|
ORDER BY refclassid, cl.relkind
|
||||||
|
|
|
@ -3,7 +3,8 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
||||||
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -13,10 +14,12 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname, fs.srvname, fdw.fdwname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
||||||
|
@ -37,6 +40,9 @@ LEFT JOIN pg_namespace ns ON dep.objid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
||||||
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.objid
|
LEFT JOIN pg_foreign_server fs ON fs.oid=dep.objid
|
||||||
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.objid
|
LEFT JOIN pg_foreign_data_wrapper fdw ON fdw.oid=dep.objid
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.objid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.objid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
|
|
|
@ -5,7 +5,8 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype = 0 THEN 'y'::text
|
||||||
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
WHEN ty.oid IS NOT NULL AND ty.typbasetype != 0 THEN 'd'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -13,10 +14,12 @@ SELECT DISTINCT dep.deptype, dep.refclassid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL OR att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
LEFT JOIN pg_class cl ON dep.refobjid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.refobjid=att.attrelid AND dep.refobjsubid=att.attnum
|
||||||
|
@ -35,8 +38,11 @@ LEFT JOIN pg_namespace nsrw ON clrw.relnamespace=nsrw.oid
|
||||||
LEFT JOIN pg_language la ON dep.refobjid=la.oid
|
LEFT JOIN pg_language la ON dep.refobjid=la.oid
|
||||||
LEFT JOIN pg_namespace ns ON dep.refobjid=ns.oid
|
LEFT JOIN pg_namespace ns ON dep.refobjid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
LEFT JOIN pg_attrdef ad ON ad.adrelid=att.attrelid AND ad.adnum=att.attnum
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.refobjid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.refobjid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
refclassid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
'pg_trigger', 'pg_type', 'pg_attrdef', 'pg_event_trigger', 'pg_foreign_server', 'pg_foreign_data_wrapper'))
|
'pg_trigger', 'pg_type', 'pg_attrdef', 'pg_event_trigger', 'pg_foreign_server', 'pg_foreign_data_wrapper'))
|
||||||
ORDER BY refclassid, cl.relkind
|
ORDER BY refclassid, cl.relkind
|
||||||
|
|
|
@ -4,7 +4,8 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
WHEN tg.oid IS NOT NULL THEN 'T'::text
|
||||||
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
WHEN ty.oid IS NOT NULL THEN 'y'::text
|
||||||
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
WHEN ns.oid IS NOT NULL THEN 'n'::text
|
||||||
WHEN pr.oid IS NOT NULL THEN 'p'::text
|
WHEN pr.oid IS NOT NULL AND prtyp.typname = 'trigger' THEN 't'::text
|
||||||
|
WHEN pr.oid IS NOT NULL THEN 'P'::text
|
||||||
WHEN la.oid IS NOT NULL THEN 'l'::text
|
WHEN la.oid IS NOT NULL THEN 'l'::text
|
||||||
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
WHEN rw.oid IS NOT NULL THEN 'R'::text
|
||||||
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
WHEN co.oid IS NOT NULL THEN 'C'::text || contype
|
||||||
|
@ -12,10 +13,12 @@ SELECT DISTINCT dep.deptype, dep.classid, cl.relkind, ad.adbin, ad.adsrc,
|
||||||
ELSE ''
|
ELSE ''
|
||||||
END AS type,
|
END AS type,
|
||||||
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
COALESCE(coc.relname, clrw.relname) AS ownertable,
|
||||||
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || '.' || att.attname
|
CASE WHEN cl.relname IS NOT NULL AND att.attname IS NOT NULL THEN cl.relname || COALESCE('.' || att.attname, '')
|
||||||
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname)
|
ELSE COALESCE(cl.relname, co.conname, pr.proname, tg.tgname, ty.typname, la.lanname, rw.rulename, ns.nspname)
|
||||||
END AS refname,
|
END AS refname,
|
||||||
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname
|
COALESCE(nsc.nspname, nso.nspname, nsp.nspname, nst.nspname, nsrw.nspname) AS nspname,
|
||||||
|
CASE WHEN inhits.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherits,
|
||||||
|
CASE WHEN inhed.inhparent IS NOT NULL THEN '1' ELSE '0' END AS is_inherited
|
||||||
FROM pg_depend dep
|
FROM pg_depend dep
|
||||||
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
LEFT JOIN pg_class cl ON dep.objid=cl.oid
|
||||||
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
LEFT JOIN pg_attribute att ON dep.objid=att.attrelid AND dep.objsubid=att.attnum
|
||||||
|
@ -34,6 +37,9 @@ LEFT JOIN pg_namespace nsrw ON clrw.relnamespace=nsrw.oid
|
||||||
LEFT JOIN pg_language la ON dep.objid=la.oid
|
LEFT JOIN pg_language la ON dep.objid=la.oid
|
||||||
LEFT JOIN pg_namespace ns ON dep.objid=ns.oid
|
LEFT JOIN pg_namespace ns ON dep.objid=ns.oid
|
||||||
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
LEFT JOIN pg_attrdef ad ON ad.oid=dep.objid
|
||||||
|
LEFT JOIN pg_type prtyp ON prtyp.oid = pr.prorettype
|
||||||
|
LEFT JOIN pg_inherits inhits ON (inhits.inhrelid=dep.objid)
|
||||||
|
LEFT JOIN pg_inherits inhed ON (inhed.inhparent=dep.objid)
|
||||||
{{where_clause}} AND
|
{{where_clause}} AND
|
||||||
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
classid IN ( SELECT oid FROM pg_class WHERE relname IN
|
||||||
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
('pg_class', 'pg_constraint', 'pg_conversion', 'pg_language', 'pg_proc', 'pg_rewrite', 'pg_namespace',
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
.icon-{{node_type}} {
|
{% if file_name is not defined %}
|
||||||
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/%s.svg' % node_type )}}') !important;
|
{% set file_name=node_type %}
|
||||||
|
{% endif %}
|
||||||
|
.icon-{{file_name}} {
|
||||||
|
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/%s.svg' % file_name )}}') !important;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 20px !important;
|
background-size: 20px !important;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
@ -7,8 +10,8 @@
|
||||||
height: 15px;
|
height: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pgadmin-node-select option[node="{{node_type}}"] {
|
.pgadmin-node-select option[node="{{file_name}}"] {
|
||||||
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/%s.svg' % node_type )}}') !important;
|
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/%s.svg' % file_name )}}') !important;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 20px !important;
|
background-size: 20px !important;
|
||||||
background-position: center left;
|
background-position: center left;
|
||||||
|
|
|
@ -461,10 +461,12 @@ class PGChildNodeView(NodeView):
|
||||||
'S': 'sequence',
|
'S': 'sequence',
|
||||||
'v': 'view',
|
'v': 'view',
|
||||||
'x': 'external_table',
|
'x': 'external_table',
|
||||||
'p': 'function',
|
'p': 'partition',
|
||||||
|
'P': 'function',
|
||||||
'n': 'schema',
|
'n': 'schema',
|
||||||
'y': 'type',
|
'y': 'type',
|
||||||
'd': 'domain',
|
'd': 'domain',
|
||||||
|
't': 'trigger_function',
|
||||||
'T': 'trigger',
|
'T': 'trigger',
|
||||||
'l': 'language',
|
'l': 'language',
|
||||||
'f': 'foreign_data_wrapper',
|
'f': 'foreign_data_wrapper',
|
||||||
|
@ -500,6 +502,7 @@ class PGChildNodeView(NodeView):
|
||||||
ref_name = nsp_name + '.'
|
ref_name = nsp_name + '.'
|
||||||
|
|
||||||
type_name = ''
|
type_name = ''
|
||||||
|
icon = None
|
||||||
|
|
||||||
# Fetch the type name from the dictionary
|
# Fetch the type name from the dictionary
|
||||||
# if type is not present in the types dictionary then
|
# if type is not present in the types dictionary then
|
||||||
|
@ -514,6 +517,25 @@ class PGChildNodeView(NodeView):
|
||||||
type_name = 'column'
|
type_name = 'column'
|
||||||
else:
|
else:
|
||||||
type_name = 'table'
|
type_name = 'table'
|
||||||
|
if 'is_inherits' in row \
|
||||||
|
and row['is_inherits'] == '1':
|
||||||
|
if 'is_inherited' in row \
|
||||||
|
and row['is_inherited'] == '1':
|
||||||
|
icon = 'icon-table-multi-inherit'
|
||||||
|
# For tables under partitioned tables,
|
||||||
|
# is_inherits will be true and dependency
|
||||||
|
# will be auto as it inherits from parent
|
||||||
|
# partitioned table
|
||||||
|
elif ('is_inherited' in row and
|
||||||
|
row['is_inherited'] == '0')\
|
||||||
|
and dep_str == 'a':
|
||||||
|
type_name = 'partition'
|
||||||
|
else:
|
||||||
|
icon = 'icon-table-inherits'
|
||||||
|
elif 'is_inherited' in row \
|
||||||
|
and row['is_inherited'] == '1':
|
||||||
|
icon = 'icon-table-inherited'
|
||||||
|
|
||||||
elif type_str[0] == 'R':
|
elif type_str[0] == 'R':
|
||||||
type_name = 'rule'
|
type_name = 'rule'
|
||||||
ref_name = \
|
ref_name = \
|
||||||
|
@ -569,7 +591,8 @@ class PGChildNodeView(NodeView):
|
||||||
{
|
{
|
||||||
'type': type_name,
|
'type': type_name,
|
||||||
'name': ref_name,
|
'name': ref_name,
|
||||||
'field': dep_type
|
'field': dep_type,
|
||||||
|
'icon': icon,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,12 @@ define('misc.dependencies', [
|
||||||
// This function is used to fetch/set the icon for the type(Function, Role, Database, ....)
|
// This function is used to fetch/set the icon for the type(Function, Role, Database, ....)
|
||||||
parse: function(res) {
|
parse: function(res) {
|
||||||
var node = pgBrowser.Nodes[res.type];
|
var node = pgBrowser.Nodes[res.type];
|
||||||
res.icon = node ? (_.isFunction(node['node_image']) ?
|
if(res.icon == null || res.icon == '') {
|
||||||
(node['node_image']).apply(node, [null, null]) :
|
res.icon = node ? (_.isFunction(node['node_image']) ?
|
||||||
(node['node_image'] || ('icon-' + res.type))) :
|
(node['node_image']).apply(node, [null, null]) :
|
||||||
('icon-' + res.type);
|
(node['node_image'] || ('icon-' + res.type))) :
|
||||||
|
('icon-' + res.type);
|
||||||
|
}
|
||||||
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
|
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
|
@ -46,10 +46,12 @@ define('misc.dependents', [
|
||||||
// This function is used to fetch/set the icon for the type(Function, Role, Database, ....)
|
// This function is used to fetch/set the icon for the type(Function, Role, Database, ....)
|
||||||
parse: function(res) {
|
parse: function(res) {
|
||||||
var node = pgBrowser.Nodes[res.type];
|
var node = pgBrowser.Nodes[res.type];
|
||||||
res.icon = node ? (_.isFunction(node['node_image']) ?
|
if(res.icon == null || res.icon == '') {
|
||||||
(node['node_image']).apply(node, [null, null]) :
|
res.icon = node ? (_.isFunction(node['node_image']) ?
|
||||||
(node['node_image'] || ('icon-' + res.type))) :
|
(node['node_image']).apply(node, [null, null]) :
|
||||||
('icon-' + res.type);
|
(node['node_image'] || ('icon-' + res.type))) :
|
||||||
|
('icon-' + res.type);
|
||||||
|
}
|
||||||
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
|
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue