Fix missing Greenplum reloptions [Chuck McDevitt]
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 1 Apr 2009 12:09:33 +0000 (12:09 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 1 Apr 2009 12:09:33 +0000 (12:09 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7787 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/include/schema/pgTable.h
pgadmin/schema/gpPartition.cpp
pgadmin/schema/pgTable.cpp

index faaf464ac3a1596e99be0452ddafe1782689d62e..a771ffd923c33290e8a8890db4b6ca2f79c8efc1 100644 (file)
@@ -105,6 +105,12 @@ public:
     void iSetCompressLevel(const wxString& s) { compressLevel = s; }
     wxString GetIsColumnStore() { return columnstore; }
     void iSetIsColumnStore(const wxString& s) { columnstore = s; }
+    wxString GetCompressType() { return compresstype; }
+    void iSetCompressType(const wxString& s) { compresstype = s; };
+    wxString GetBlocksize() { return blocksize; }
+    void iSetBlocksize(const wxString& s) { blocksize = s; };
+    wxString GetChecksum() { return checksum; }
+    void iSetChecksum(const wxString& s) { checksum = s; };
     wxString GetPartitionDef() { return partitionDef; }
     void iSetPartitionDef(const wxString& s) { partitionDef = s; }
     bool GetIsPartitioned() const { return isPartitioned || partitionDef.Length() > 0; }
@@ -204,6 +210,9 @@ private:
     wxString appendOnly;
     wxString compressLevel;
     wxString columnstore;
+    wxString compresstype;
+    wxString blocksize;
+    wxString checksum;
     wxString partitionDef;
     bool isPartitioned;
     bool hasOids, hasSubclass, rowsCounted, isReplicated, showExtendedStatistics, distributionIsRandom;
index becc0370de30da5ee3466850d839567967516545..028a6885474533d3ee864f77b9ee85b9770f9b99 100644 (file)
@@ -110,6 +110,9 @@ pgObject *gpPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser
        query += wxT(", substring(array_to_string(reloptions, ',') from 'appendonly=([a-z]*)') AS appendonly \n");
        query += wxT(", substring(array_to_string(reloptions, ',') from 'compresslevel=([0-9]*)') AS compresslevel \n");
     query += wxT(", substring(array_to_string(reloptions, ',') from 'columnstore=([a-z]*)') AS columnstore \n");
+    query += wxT(", substring(array_to_string(reloptions, ',') from 'compresstype=([a-z0-9]*)') AS compresstype \n");
+    query += wxT(", substring(array_to_string(reloptions, ',') from 'blocksize=([0-9]*)') AS blocksize \n");
+    query += wxT(", substring(array_to_string(reloptions, ',') from 'checksum=([a-z]*)') AS checksum \n");
        //query += wxT(", rel.oid in (select parrelid from pg_partition) as ispartitioned\n"); // This only works for top-level tables, not intermediate ones
        // This looks for intermediate partitions that have subpartitions
        query += wxT(", rel.oid in (select pr.parchildrelid from pg_partition_rule pr, pg_partition pp where pr.paroid = pp.oid and pp.parlevel < (select max(parlevel) from pg_partition where parrelid = pp.parrelid)) as ispartitioned \n");
@@ -170,6 +173,9 @@ pgObject *gpPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser
                        table->iSetAppendOnly(tables->GetVal(wxT("appendonly")));
                        table->iSetCompressLevel(tables->GetVal(wxT("compresslevel")));
             table->iSetIsColumnStore(tables->GetVal(wxT("columnstore")));
+            table->iSetCompressType(tables->GetVal(wxT("compresstype")));
+            table->iSetBlocksize(tables->GetVal(wxT("blocksize")));
+            table->iSetChecksum(tables->GetVal(wxT("checksum")));
 
                        table->iSetPartitionDef(wxT(""));
                        table->iSetIsPartitioned(tables->GetBool(wxT("ispartitioned"))); 
index 88eb9d4351a2da5fd80401a459605338ae11c60e..81e55757101fa72e3e8c26eaac09229248ebceee 100644 (file)
@@ -350,6 +350,12 @@ wxString pgTable::GetSql(ctlTree *browser)
                 sql += wxT("COMPRESSLEVEL=") + GetCompressLevel() + wxT(", ");
             if (GetIsColumnStore().Length() > 0)
                 sql += wxT("COLUMNSTORE=") + GetIsColumnStore() + wxT(", ");
+            if (GetCompressType().Length() > 0)
+                sql += wxT("COMPRESSTYPE=") + GetCompressType() + wxT(", ");
+            if (GetBlocksize().Length() > 0)
+                sql += wxT("BLOCKSIZE=") + GetBlocksize() + wxT(", ");
+            if (GetChecksum().Length() > 0)
+                sql += wxT("CHECKSUM=") + GetChecksum() + wxT(", ");
             if (GetHasOids())
                 sql +=  wxT("\n  OIDS=TRUE");
             else
@@ -1205,6 +1211,9 @@ pgObject *pgTableFactory::CreateObjects(pgCollection *collection, ctlTree *brows
             query += wxT(", substring(array_to_string(rel.reloptions, ',') from 'appendonly=([a-z]*)') AS appendonly \n");
             query += wxT(", substring(array_to_string(rel.reloptions, ',') from 'compresslevel=([0-9]*)') AS compresslevel \n");
             query += wxT(", substring(array_to_string(rel.reloptions, ',') from 'columnstore=([a-z]*)') AS columnstore \n");
+            query += wxT(", substring(array_to_string(rel.reloptions, ',') from 'compresstype=([a-z0-9]*)') AS compresstype \n");
+            query += wxT(", substring(array_to_string(reloptions, ',') from 'blocksize=([0-9]*)') AS blocksize \n");
+            query += wxT(", substring(array_to_string(reloptions, ',') from 'checksum=([a-z]*)') AS checksum \n");
             if (collection->GetConnection()->GetIsGreenplum() && collection->GetConnection()->BackendMinimumVersion(8, 2, 9))
                 query += wxT(", rel.oid in (select parrelid from pg_partition) as ispartitioned\n");
         }
@@ -1371,6 +1380,9 @@ pgObject *pgTableFactory::CreateObjects(pgCollection *collection, ctlTree *brows
                 table->iSetAppendOnly(tables->GetVal(wxT("appendonly")));
                 table->iSetCompressLevel(tables->GetVal(wxT("compresslevel")));
                 table->iSetIsColumnStore(tables->GetVal(wxT("columnstore")));
+                table->iSetCompressType(tables->GetVal(wxT("compresstype")));
+                table->iSetBlocksize(tables->GetVal(wxT("blocksize")));
+                table->iSetChecksum(tables->GetVal(wxT("checksum")));
 
                 table->iSetPartitionDef(wxT(""));
                 table->iSetIsPartitioned(false);