Permalink
Browse files

Hide the dbms_job_procedure schema on EDB by default. [Ashesh Vashi]

git-svn-id: svn://svn.pgadmin.org/trunk@7879 a7884b65-44f6-0310-8a51-81a127f17b15
  • Loading branch information...
1 parent 161f170 commit c17be11351fd1b3a6a4c7a27576dd7d8c92d8b2e @dpage dpage committed May 21, 2009
Showing with 13 additions and 3 deletions.
  1. +1 −1 pgadmin/dlg/dlgSynonym.cpp
  2. +6 −1 pgadmin/gqb/gqbDatabase.cpp
  3. +6 −1 pgadmin/schema/pgSchema.cpp
@@ -131,7 +131,7 @@ void dlgSynonym::ProcessTypeChange()
{
pgSet *schemas;
if (connection->BackendMinimumVersion(8, 2))
- schemas = connection->ExecuteSet(wxT("SELECT nspname FROM pg_namespace WHERE nspparent = 0 AND nspname NOT LIKE E'pg\\_%' AND nspname NOT IN ('pg_catalog', 'sys', 'dbo', 'pgagent', 'information_schema') ORDER BY nspname;"));
+ schemas = connection->ExecuteSet(wxT("SELECT nspname FROM pg_namespace WHERE nspparent = 0 AND nspname NOT LIKE E'pg\\_%' AND nspname NOT IN ('pg_catalog', 'sys', 'dbo', 'pgagent', 'information_schema', 'dbms_job_procedure') ORDER BY nspname;"));
else if (connection->BackendMinimumVersion(8, 1))
schemas = connection->ExecuteSet(wxT("SELECT nspname FROM pg_namespace WHERE nspname NOT LIKE E'pg\\_%' ORDER BY nspname;"));
else
@@ -61,7 +61,12 @@ void gqbDatabase::createSchemas(gqbBrowser *tablesBrowser, wxTreeItemId parentNo
restr += wxT("(nspname = 'sys' AND EXISTS (SELECT 1 FROM pg_class WHERE relname = 'all_tables' AND relnamespace = nsp.oid LIMIT 1)))\n");
if (conn->EdbMinimumVersion(8, 2))
- restr += wxT(" AND nspparent = 0\n");
+ {
+ restr += wxT(" AND nsp.nspparent = 0\n");
+ // Do not show dbms_job_procedure in schemas
+ if (!settings->GetShowSystemObjects())
+ restr += wxT("AND NOT (nspname = 'dbms_job_procedure' AND EXISTS(SELECT 1 FROM pg_proc WHERE pronamespace = nsp.oid and proname = 'run_job' LIMIT 1))\n");
+ }
wxString sql;
@@ -315,7 +315,12 @@ pgObject *pgSchemaBaseFactory::CreateObjects(pgCollection *collection, ctlTree *
restr += wxT("(nspname = 'sys' AND EXISTS (SELECT 1 FROM pg_class WHERE relname = 'all_tables' AND relnamespace = nsp.oid LIMIT 1)))\n");
if (collection->GetConnection()->EdbMinimumVersion(8, 2))
- restr += wxT(" AND nsp.nspparent = 0\n");
+ {
+ restr += wxT(" AND nsp.nspparent = 0\n");
+ // Do not show dbms_job_procedure in schemas
+ if (!settings->GetShowSystemObjects())
+ restr += wxT("AND NOT (nspname = 'dbms_job_procedure' AND EXISTS(SELECT 1 FROM pg_proc WHERE pronamespace = nsp.oid and proname = 'run_job' LIMIT 1))\n");
+ }
if (!collection->GetDatabase()->GetSchemaRestriction().IsEmpty())
restr += wxT(" AND nspname IN (") + collection->GetDatabase()->GetSchemaRestriction() + wxT(")");

0 comments on commit c17be11

Please sign in to comment.