Fixes #1300 - Honour show system object in the table dialog, and do not

show catalog schema tables.
pull/3/head
Murtuza Zabuawala 2016-06-03 15:45:10 +05:30 committed by Ashesh Vashi
parent 9c8637cf0f
commit c14ff8e15e
3 changed files with 12 additions and 5 deletions

View File

@ -1247,7 +1247,8 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
"""
res = [{'label': '', 'value': ''}]
try:
SQL = render_template("/".join([self.template_path, 'get_relations.sql']))
SQL = render_template("/".join([self.template_path, 'get_relations.sql']),
show_sys_objects=self.blueprint.show_system_objects)
status, rset = self.conn.execute_2darray(SQL)
if not status:
return internal_server_error(errormsg=res)

View File

@ -1,6 +1,9 @@
SELECT c.oid, quote_ident(n.nspname)||'.'||quote_ident(c.relname) AS like_relation
FROM pg_class c, pg_namespace n
WHERE c.relnamespace=n.oid
AND
c.relkind IN ('r', 'v', 'f')
AND c.relkind IN ('r', 'v', 'f')
{% if not show_sys_objects %}
AND n.nspname NOT LIKE E'pg\\_%'
AND n.nspname NOT in ('information_schema', 'sys')
{% endif %}
ORDER BY 1;

View File

@ -1,6 +1,9 @@
SELECT c.oid, quote_ident(n.nspname)||'.'||quote_ident(c.relname) AS like_relation
FROM pg_class c, pg_namespace n
WHERE c.relnamespace=n.oid
AND
c.relkind IN ('r', 'v', 'f')
AND c.relkind IN ('r', 'v', 'f')
{% if not show_sys_objects %}
AND n.nspname NOT LIKE E'pg\\_%'
AND n.nspname NOT in ('information_schema', 'sys')
{% endif %}
ORDER BY 1;