SVN Commit by dpage: r4473 - trunk/pgadmin3/src/schema

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4473 - trunk/pgadmin3/src/schema
Date: 2005-09-27 09:09:15
Message-ID: 200509270909.j8R99FNL011572@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2005-09-27 10:09:14 +0100 (Tue, 27 Sep 2005)
New Revision: 4473

Modified:
trunk/pgadmin3/src/schema/pgSchema.cpp
Log:
Fix system schema handling.

Modified: trunk/pgadmin3/src/schema/pgSchema.cpp
===================================================================
--- trunk/pgadmin3/src/schema/pgSchema.cpp 2005-09-26 21:54:14 UTC (rev 4472)
+++ trunk/pgadmin3/src/schema/pgSchema.cpp 2005-09-27 09:09:14 UTC (rev 4473)
@@ -166,8 +166,8 @@

pgSet *schemas = collection->GetDatabase()->ExecuteSet(
wxT("SELECT CASE WHEN nspname LIKE 'pg\\_temp\\_%%' THEN 1\n")
- wxT(" WHEN nsp.oid<") + NumToStr(collection->GetServer()->GetLastSystemOID()) +
- wxT(" OR nspname like 'pg\\_%' THEN 0\n")
+ wxT(" WHEN (nsp.oid<") + NumToStr(collection->GetServer()->GetLastSystemOID()) +
+ wxT(" OR nspname like 'pg\\_%') AND nspname != 'public' THEN 0\n")
wxT(" ELSE 3 END AS nsptyp,\n")
wxT(" nsp.nspname, nsp.oid, pg_get_userbyid(nspowner) AS namespaceowner, nspacl, description,")
wxT(" has_schema_privilege(nsp.oid, 'CREATE') as cancreate\n")
@@ -182,24 +182,24 @@
{
wxString name=schemas->GetVal(wxT("nspname"));
long nsptyp=schemas->GetLong(wxT("nsptyp"));
- if (nsptyp == SCHEMATYP_NORMAL)
+
+ wxStringTokenizer tokens(settings->GetSystemSchemas(), wxT(","));
+ while (tokens.HasMoreTokens())
{
- wxStringTokenizer tokens(settings->GetSystemSchemas(), wxT(","));
- while (tokens.HasMoreTokens())
+ wxRegEx regex(tokens.GetNextToken());
+ if (regex.Matches(name))
{
- wxRegEx regex(tokens.GetNextToken());
- if (regex.Matches(name))
- {
- nsptyp = SCHEMATYP_USERSYS;
- break;
- }
+ nsptyp = SCHEMATYP_USERSYS;
+ break;
}
- if (nsptyp == SCHEMATYP_USERSYS && !settings->GetShowSystemObjects())
- {
- schemas->MoveNext();
- continue;
- }
}
+
+ if (nsptyp <= SCHEMATYP_USERSYS && !settings->GetShowSystemObjects())
+ {
+ schemas->MoveNext();
+ continue;
+ }
+
schema = new pgSchema(name);
schema->iSetSchemaTyp(nsptyp);
schema->iSetDatabase(collection->GetDatabase());

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2005-09-27 09:11:51 Re: cannot disable displaying of system objects
Previous Message Miha Radej 2005-09-27 08:13:17 cannot disable displaying of system objects