This patch fixes a problem when using pgAdmin with the Greenplum database 3.4 release.
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Tue, 23 Jun 2009 12:07:27 +0000 (12:07 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Tue, 23 Jun 2009 12:07:27 +0000 (12:07 +0000)
There was a catalog change on how external tables are identified.

The patch allows the code to work with 3.2, 3.3, or 3.4 releases of external tables.
[Chuck McDevitt]

git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7940 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/schema/gpExtTable.cpp
pgadmin/schema/pgTable.cpp

index 4b9777d52d6bfeb072b1bc0f3a7a06f45643b6a3..a9f63ae220b6f0d1377938a1ea4296d6d63ef1f5 100644 (file)
@@ -429,7 +429,7 @@ pgObject *gpExtTableFactory::CreateObjects(pgCollection *collection, ctlTree *br
         wxT("SELECT c.oid, c.xmin, c.relname, pg_get_userbyid(c.relowner) AS exttableowner, c.relacl AS relacl, description \n")
         wxT("  FROM pg_class c\n")
         wxT("  LEFT OUTER JOIN pg_description des ON (des.objoid=c.oid and des.objsubid=0)\n")
-        wxT(" WHERE  (c.relkind = 'x'::char)\n")
+        wxT(" WHERE  (c.relkind = 'x' OR (c.relkind = 'r' AND c.relstorage = 'x'))\n")
         wxT("   AND relnamespace = ") + collection->GetSchema()->GetOidStr() + wxT("\n")
         + restriction
         + wxT(" ORDER BY relname"));
index cf60da36f68bc5252fcce2b21b25d91ea2ac4a97..eb6508232a50d376a94bfda32dbc78e56c2bd63f 100644 (file)
@@ -1257,8 +1257,9 @@ pgObject *pgTableFactory::CreateObjects(pgCollection *collection, ctlTree *brows
         query += wxT(" WHERE relkind IN ('r','s','t') AND relnamespace = ") + collection->GetSchema()->GetOidStr() + wxT("\n");
 
         // Greenplum: Eliminate (sub)partitions from the display, only show the parent partitioned table
+        // and eliminate external tables
         if (collection->GetConnection()->GetIsGreenplum() && collection->GetConnection()->BackendMinimumVersion(8, 2, 9))
-            query += wxT("AND rel.oid NOT IN (select parchildrelid from pg_partition_rule)");
+            query += wxT("AND rel.relstorage <> 'x' AND rel.oid NOT IN (select parchildrelid from pg_partition_rule)");
 
         query += restriction + 
             wxT(" ORDER BY relname");