Thread: SVN Commit by andreas: r4414 - in trunk/pgadmin3: . src/include/base src/include/images src/schema
SVN Commit by andreas: r4414 - in trunk/pgadmin3: . src/include/base src/include/images src/schema
From
svn@pgadmin.org
Date:
Author: andreas Date: 2005-08-23 12:05:31 +0100 (Tue, 23 Aug 2005) New Revision: 4414 Modified: trunk/pgadmin3/CHANGELOG.txt trunk/pgadmin3/src/include/base/pgDefs.h trunk/pgadmin3/src/include/images/constraints.xpm trunk/pgadmin3/src/include/images/domain-sm.xpm trunk/pgadmin3/src/include/images/domain.xpm trunk/pgadmin3/src/include/images/domains.xpm trunk/pgadmin3/src/schema/pgObject.cpp trunk/pgadmin3/src/schema/pgRole.cpp Log: shared dependencies, icon fixes Modified: trunk/pgadmin3/CHANGELOG.txt =================================================================== --- trunk/pgadmin3/CHANGELOG.txt 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/CHANGELOG.txt 2005-08-23 11:05:31 UTC (rev 4414) @@ -17,6 +17,7 @@ </ul> <br> <ul> + <li>2005-08-23 AP shared dependencies <li>2005-08-21 AP Roles <li>2005-08-21 AP smaller icons for win32 <li>2005-08-11 DP New set of icons, custom designed by Niko [ennixo at free.fr] Modified: trunk/pgadmin3/src/include/base/pgDefs.h =================================================================== --- trunk/pgadmin3/src/include/base/pgDefs.h 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/include/base/pgDefs.h 2005-08-23 11:05:31 UTC (rev 4414) @@ -16,6 +16,8 @@ #define PGOID_SCHEMA_TOAST 99L #define PGOID_SCHEMA_PUBLIC 2200L +#define PGOID_CLASS_PG_AUTHID 1260L + #define PGOID_TYPE_SERIAL -42L #define PGOID_TYPE_SERIAL8 -43L #define PGOID_TYPE_BOOL 16L Modified: trunk/pgadmin3/src/include/images/constraints.xpm =================================================================== --- trunk/pgadmin3/src/include/images/constraints.xpm 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/include/images/constraints.xpm 2005-08-23 11:05:31 UTC (rev 4414) @@ -2,8 +2,8 @@ static char * constraints_xpm[] = { "16 16 12 1", " c None", -". c #BF3C14", -"+ c #D98C75", +". c #D98C75", +"+ c #BF3C14", "@ c #E7BC9C", "# c #E7A381", "$ c #E7B291", @@ -15,17 +15,17 @@ "; c #E64318", " ", " ", +" . ", +" ++. + ", +" +@+. +#+ ", +" +@$+. +#%+ ", +" +$#%+. +#%&+ ", +" +#%&*+ +#%&*+ ", +" +%&*+ .+&*=+ ", +" +&*+ .+=-+ ", +" +*+ .+;+ ", +" .+ .+. ", " ", -" .+ . ", -" .@.+ +.#. ", -" .@$.+ .#%. ", -" .$#%.+ .#%&. ", -" .#%&*. .#%&*. ", -" .%&*. +.&*=. ", -" .&*. +.=-. ", -" .*. +.;. ", -" +. .+ ", " ", " ", -" ", " "}; Modified: trunk/pgadmin3/src/include/images/domain-sm.xpm =================================================================== --- trunk/pgadmin3/src/include/images/domain-sm.xpm 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/include/images/domain-sm.xpm 2005-08-23 11:05:31 UTC (rev 4414) @@ -1,6 +1,6 @@ /* XPM */ static char * domain_sm_xpm[] = { -"16 16 35 1", +"16 16 34 1", " c None", ". c #DC5B5B", "+ c #C84040", @@ -19,13 +19,13 @@ ") c #E4E9F5", "! c #E1E4F0", "~ c #DAB9C3", -"{ c #6F6F6F", -"] c #D64F52", -"^ c #E1E8F4", -"/ c #DEE7F4", -"( c #DBE2EF", -"_ c #D6B7C3", -": c #DC5454", +"{ c #D64F52", +"] c #E1E8F4", +"^ c #DEE7F4", +"/ c #DBE2EF", +"( c #D6B7C3", +"_ c #DC5454", +": c #6F6F6F", "< c #E6EAF5", "[ c #DBE5F3", "} c #D8E4F3", @@ -35,7 +35,6 @@ "3 c #CFE1F2", "4 c #CDE0F1", "5 c #CBDFF1", -"6 c #AAAAAA", " ", " ", " . ", @@ -43,12 +42,12 @@ " $%&%* ", " =%-;>%, ", " +%-')!~%+ ", -" {]%-')^/(_%: ", -" { {<)^/[}|{ ", -" { {)^111|2{ ", -" {^/11123{ ", -" {/[11134{ ", -" {[}11145{ ", -" 6{{{{{{{ ", +" {%-')]^/(%_ ", +" :<)]^[}|: ", +" :)]111|2: ", +" :]^11123: ", +" :^[11134: ", +" :[}11145: ", +" ::::::::: ", " ", " "}; Modified: trunk/pgadmin3/src/include/images/domain.xpm =================================================================== --- trunk/pgadmin3/src/include/images/domain.xpm 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/include/images/domain.xpm 2005-08-23 11:05:31 UTC (rev 4414) @@ -1,6 +1,6 @@ /* XPM */ static char * domain_xpm[] = { -"16 16 37 1", +"16 16 36 1", " c None", ". c #E16B6B", "+ c #C84040", @@ -37,7 +37,6 @@ "5 c #CDE0F2", "6 c #CCE0F1", "7 c #CADFF1", -"8 c #AAAAAA", " ", " . ", " +@+ ", @@ -52,5 +51,5 @@ " |'^/111345| ", " |^/<111456| ", " |/<[111567| ", -" 8||||||||| ", +" ||||||||||| ", " "}; Modified: trunk/pgadmin3/src/include/images/domains.xpm =================================================================== --- trunk/pgadmin3/src/include/images/domains.xpm 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/include/images/domains.xpm 2005-08-23 11:05:31 UTC (rev 4414) @@ -1,6 +1,6 @@ /* XPM */ static char * domains_xpm[] = { -"16 16 43 1", +"16 16 42 1", " c None", ". c #E16B6B", "+ c #C84040", @@ -38,15 +38,14 @@ "6 c #E6EAF5", "7 c #D8E4F3", "8 c #D5E3F3", -"9 c #AAAAAA", -"0 c #81602B", -"a c #D2E2F2", -"b c #CFE1F2", -"c c #CDE0F1", -"d c #CBDFF1", +"9 c #81602B", +"0 c #D2E2F2", +"a c #CFE1F2", +"b c #CDE0F1", +"c c #CBDFF1", " . ", " +@+ ", -" #$%& ", +" +#$%& ", " +#*=-@; ", " +#*>,#$%' ", ")#*>,#*=-@! ", @@ -55,8 +54,8 @@ " ~<~{,#/[}|1#+ ", " ~2~^#/[}<234#) ", " ~5~<~6}<2578~ ", -" 9~~2~}<0008a~ ", -" ~5~<2000ab~ ", -" 9~~25000bc~ ", -" ~57000cd~ ", -" 9~~~~~~~ "}; +" ~~~2~}<99980~ ", +" ~5~<29990a~ ", +" ~~~25999ab~ ", +" ~57999bc~ ", +" ~~~~~~~~~ "}; Modified: trunk/pgadmin3/src/schema/pgObject.cpp =================================================================== --- trunk/pgadmin3/src/schema/pgObject.cpp 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/schema/pgObject.cpp 2005-08-23 11:05:31 UTC (rev 4414) @@ -39,10 +39,10 @@ #include "pgIndexConstraint.h" #include "pgForeignKey.h" #include "pgRule.h" +#include "pgRole.h" +#include "pgDefs.h" -// Ordering must match the PG_OBJTYPE enumeration in pgObject.h - int pgObject::GetType() const { if (factory) @@ -347,6 +347,32 @@ wxT(" LEFT JOIN pg_language la ON dep.refobjid=la.oid\n") wxT(" LEFT JOIN pg_namespace ns ON dep.refobjid=ns.oid\n") + where, wxT("refclassid")); + + pgConn *conn=GetConnection(); + if (conn && conn->BackendMinimumVersion(8, 1)) + { + int iconId=groupRoleFactory.GetCollectionFactory()->GetIconId(); + + pgSetIterator set(conn, + wxT("SELECT rolname AS refname, refclassid, deptype\n") + wxT(" FROM pg_shdepend dep\n") + wxT(" LEFT JOIN pg_roles r ON refclassid=1260 AND refobjid=r.oid\n") + + where + wxT("\n") + wxT(" ORDER BY 1")); + + while (set.RowsLeft()) + { + wxString refname = set.GetVal(wxT("refname")); + wxString deptype = set.GetVal(wxT("deptype")); + if (deptype == wxT("a")) + deptype = wxT("ACL"); + else if (deptype == wxT("o")) + deptype = _("Owner"); + + if (set.GetOid(wxT("refclassid")) == PGOID_CLASS_PG_AUTHID) + dependsOn->AppendItem(iconId, wxT("Role"), refname, deptype); + } + } } Modified: trunk/pgadmin3/src/schema/pgRole.cpp =================================================================== --- trunk/pgadmin3/src/schema/pgRole.cpp 2005-08-21 23:25:56 UTC (rev 4413) +++ trunk/pgadmin3/src/schema/pgRole.cpp 2005-08-23 11:05:31 UTC (rev 4414) @@ -158,6 +158,12 @@ delete set; } + // We ignore classid and refclassid here because we hope that oids are unique + // across system tables. + // Strictly speaking, we'd need to join pg_shdepend to each subquery + + wxString depOids=wxT("(SELECT objid FROM pg_shdepend WHERE refobjid=") + GetOidStr() + wxT(")"); + FillOwned(form->GetBrowser(), referencedBy, dblist, wxT("SELECT cl.relkind, COALESCE(cin.nspname, cln.nspname) as nspname, COALESCE(ci.relname, cl.relname) as relname,cl.relname as indname\n") wxT(" FROM pg_class cl\n") @@ -165,19 +171,19 @@ wxT(" LEFT OUTER JOIN pg_index ind ON ind.indexrelid=cl.oid\n") wxT(" LEFT OUTER JOIN pg_class ci ON ind.indrelid=ci.oid\n") wxT(" LEFT OUTER JOIN pg_namespace cin ON ci.relnamespace=cin.oid\n") - wxT(" WHERE cl.relowner = ") + GetOidStr() + wxT(" AND cl.oid > ") + sysoid + wxT("\n") + wxT(" WHERE cl.oid IN ") + depOids + wxT(" AND cl.oid > ") + sysoid + wxT("\n") wxT("UNION ALL\n") wxT("SELECT 'n', null, nspname, null\n") - wxT(" FROM pg_namespace nsp WHERE nspowner = ") + GetOidStr() + wxT(" AND nsp.oid > ") + sysoid + wxT("\n") + wxT(" FROM pg_namespace nsp WHERE nsp.oid IN ") + depOids + wxT(" AND nsp.oid > ") + sysoid + wxT("\n") wxT("UNION ALL\n") wxT("SELECT CASE WHEN typtype='d' THEN 'd' ELSE 'y' END, null, typname, null\n") - wxT(" FROM pg_type ty WHERE typowner = ") + GetOidStr() + wxT(" AND ty.oid > ") + sysoid + wxT("\n") + wxT(" FROM pg_type ty WHERE ty.oid IN ") + depOids + wxT(" AND ty.oid > ") + sysoid + wxT("\n") wxT("UNION ALL\n") wxT("SELECT 'C', null, conname, null\n") - wxT(" FROM pg_conversion co WHERE conowner = ") + GetOidStr() + wxT(" AND co.oid > ") + sysoid + wxT("\n") + wxT(" FROM pg_conversion co WHERE co.oid IN ") + depOids + wxT(" AND co.oid > ") + sysoid + wxT("\n") wxT("UNION ALL\n") wxT("SELECT CASE WHEN prorettype=") + NumToStr(PGOID_TYPE_TRIGGER) + wxT(" THEN 'T' ELSE 'p' END, null, proname,null\n") - wxT(" FROM pg_proc pr WHERE proowner = ") + GetOidStr() + wxT(" AND pr.oid > ") + sysoid + wxT("\n") + wxT(" FROM pg_proc pr WHERE pr.oid IN ") + depOids + wxT(" AND pr.oid > ") + sysoid + wxT("\n") wxT("UNION ALL\n") wxT("SELECT 'o', null, oprname || '('::text || ") wxT("COALESCE(tl.typname, ''::text) || ") @@ -186,7 +192,7 @@ wxT(" FROM pg_operator op\n") wxT(" LEFT JOIN pg_type tl ON tl.oid=op.oprleft\n") wxT(" LEFT JOIN pg_type tr ON tr.oid=op.oprright\n") - wxT(" WHERE oprowner = ") + GetOidStr() + wxT(" AND op.oid > ") + sysoid + wxT("\n") + wxT(" WHERE op.oid IN ") + depOids + wxT(" AND op.oid > ") + sysoid + wxT("\n") wxT(" ORDER BY 1,2,3")); form->EndMsg(set != 0);