diff --git a/Release_(3.0)/pgAdmin3.exe b/Release_(3.0)/pgAdmin3.exe index d3a8a2d..c842943 100644 Binary files a/Release_(3.0)/pgAdmin3.exe and b/Release_(3.0)/pgAdmin3.exe differ diff --git a/schema/pgPartition.cpp b/schema/pgPartition.cpp index 570fdf7..8285347 100644 --- a/schema/pgPartition.cpp +++ b/schema/pgPartition.cpp @@ -247,12 +247,11 @@ pgObject *pgPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser query += wxT(",\n(SELECT array_agg(provider) FROM pg_seclabels sl2 WHERE sl2.objoid=rel.oid AND sl2.objsubid=0) AS providers"); query += wxT(",case when lk.relation=rel.oid then null else pg_get_partkeydef(rel.oid) end \n AS partkeydef"); query += wxT(",case when lk.relation=rel.oid then 'AccessExclusiveLock' else pg_get_expr(rel.relpartbound, rel.oid) end \n AS partexp"); - query += wxT(",ii.inhparent is not null AS ispartitioned"); + query += wxT(",(select count(*)from pg_inherits ii where ii.inhparent=rel.oid)>0 AS ispartitioned"); query += wxT(" FROM pg_class rel\n") wxT(" JOIN pg_inherits i ON (rel.oid = i.inhrelid) \n") - wxT(" LEFT OUTER JOIN pg_inherits ii on ii.inhparent=rel.oid\n") wxT(" LEFT JOIN pg_locks lk ON locktype='relation' and granted=true and mode='AccessExclusiveLock' and relation=rel.oid\n") wxT(" LEFT OUTER JOIN pg_tablespace spc on spc.oid=rel.reltablespace\n") wxT(" LEFT OUTER JOIN pg_description des ON (des.objoid=rel.oid AND des.objsubid=0 AND des.classoid='pg_class'::regclass)\n") diff --git a/schema/pgTable.cpp b/schema/pgTable.cpp index 7f235a1..b424f9a 100644 --- a/schema/pgTable.cpp +++ b/schema/pgTable.cpp @@ -1526,7 +1526,7 @@ pgObject *pgTableFactory::CreateObjects(pgCollection *collection, ctlTree *brows { query += wxT(",case when lk.relation=rel.oid then null else pg_get_partkeydef(rel.oid) end \n AS partkeydef"); query += wxT(",case when lk.relation=rel.oid then null else pg_get_expr(rel.relpartbound, rel.oid) end \n AS partexp"); - query += wxT(",ii.inhparent is not null AS ispartitioned"); + query += wxT(",(select count(*)from pg_inherits ii where ii.inhparent=rel.oid) >0 AS ispartitioned"); //pg10=wxT("pg_get_expr(rel.relpartbound, rel.oid) is null and"); pg10=wxT("(rel.relpartbound is null and i.inhrelid is null) and"); //query += wxT(",\n(SELECT array_agg(provider) FROM pg_seclabels sl2 WHERE sl2.objoid=rel.oid AND sl2.objsubid=0) AS providers"); @@ -1537,7 +1537,6 @@ pgObject *pgTableFactory::CreateObjects(pgCollection *collection, ctlTree *brows wxT(" LEFT OUTER JOIN pg_tablespace spc on spc.oid=rel.reltablespace\n") wxT(" LEFT OUTER JOIN pg_description des ON (des.objoid=rel.oid AND des.objsubid=0 AND des.classoid='pg_class'::regclass)\n") wxT(" LEFT OUTER JOIN pg_inherits i on i.inhrelid=rel.oid\n") - wxT(" LEFT OUTER JOIN pg_inherits ii on ii.inhparent=rel.oid\n") wxT(" LEFT OUTER JOIN pg_constraint con ON con.conrelid=rel.oid AND con.contype='p'\n"); // Add the toast table for vacuum parameters.