SVN Commit by andreas: r4711 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/dlg src/include/base - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by andreas: r4711 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/dlg src/include/base
Date
Msg-id 200511091135.jA9BZkkb024755@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: andreas
Date: 2005-11-09 11:35:46 +0000 (Wed, 09 Nov 2005)
New Revision: 4711

Modified:
   branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
   branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgColumn.cpp
   branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgProperty.cpp
   branches/REL-1_4_0_PATCHES/pgadmin3/src/include/base/pgDefs.h
Log:
Allow all 8.x column changes

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt    2005-11-09 11:34:53 UTC (rev 4710)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/CHANGELOG.txt    2005-11-09 11:35:46 UTC (rev 4711)
@@ -17,6 +17,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-11-09 AP  1.4.1  Allow all 8.x column changes (r: Chris Velevitch)
     <li>2005-11-09 AP  1.4.1  Fix param name quoting for procedures (r: Alex Tyagloff)
     <li>2005-11-04 AP  1.4.0  Fix SET role (r:Florian Pflug), fix role help
     <li>2005-11-04 DP  1.4.0  Fix role inheritance option when creating roles, per Mike Allen

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgColumn.cpp
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgColumn.cpp    2005-11-09 11:34:53 UTC (rev 4710)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgColumn.cpp    2005-11-09 11:35:46 UTC (rev 4711)
@@ -85,20 +85,25 @@

         if (!column->IsReferenced())
         {
-            pgSet *set=connection->ExecuteSet(
+            wxString typeSql=
                 wxT("SELECT tt.oid, tt.typname\n")
                 wxT("  FROM pg_cast\n")
                 wxT("  JOIN pg_type tt ON tt.oid=casttarget\n")
-                wxT(" WHERE castsource=") + NumToStr(column->GetAttTypId()) + wxT("\n")
-                wxT("   AND castfunc=0"));
+                wxT(" WHERE castsource=") + NumToStr(column->GetAttTypId()) + wxT("\n");

-            if (set)
+            if (connection->BackendMinimumVersion(8, 0))
+                typeSql += wxT("   AND castcontext IN ('i', 'a')");
+            else
+                typeSql += wxT("   AND castfunc=0");
+
+            pgSetIterator set(connection, typeSql);
+
+            while (set.RowsLeft())
             {
-                while (!set->Eof())
+                if (set.GetVal(wxT("typname")) != column->GetRawTypename())
                 {
-                    cbDatatype->Append(set->GetVal(wxT("typname")));
-                    AddType(wxT("?"), set->GetOid(wxT("oid")), set->GetVal(wxT("typname")));
-                    set->MoveNext();
+                    cbDatatype->Append(set.GetVal(wxT("typname")));
+                    AddType(wxT("?"), set.GetOid(wxT("oid")), set.GetVal(wxT("typname")));
                 }
             }
         }

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgProperty.cpp
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgProperty.cpp    2005-11-09 11:34:53 UTC (rev 4710)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/dlg/dlgProperty.cpp    2005-11-09 11:35:46 UTC (rev 4711)
@@ -841,6 +841,8 @@
             case PGOID_TYPE_BIT_ARRAY:
             case PGOID_TYPE_CHAR:
             case PGOID_TYPE_CHAR_ARRAY:
+            case PGOID_TYPE_BPCHAR:
+            case PGOID_TYPE_BPCHAR_ARRAY:
             case PGOID_TYPE_VARCHAR:
             case PGOID_TYPE_VARCHAR_ARRAY:
                 vartyp=wxT("L");

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/include/base/pgDefs.h
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/include/base/pgDefs.h    2005-11-09 11:34:53 UTC (rev 4710)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/include/base/pgDefs.h    2005-11-09 11:35:46 UTC (rev 4711)
@@ -36,7 +36,9 @@
 #define PGOID_TYPE_FLOAT8                   701L
 #define PGOID_TYPE_MONEY                    790L
 #define PGOID_TYPE_CHAR_ARRAY               1002L
+#define PGOID_TYPE_BPCHAR_ARRAY             1014L
 #define PGOID_TYPE_VARCHAR_ARRAY            1015L
+#define PGOID_TYPE_BPCHAR                   1042L
 #define PGOID_TYPE_VARCHAR                  1043L
 #define PGOID_TYPE_TIME                     1083L
 #define PGOID_TYPE_TIMESTAMP                1114L


pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4710 - in trunk/pgadmin3: . src/dlg src/include/base
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by andreas: r4712 - branches/REL-1_4_0_PATCHES/pgadmin3/docs/en_US