Thread: SVN Commit by andreas: r4638 - in trunk/pgadmin3: . src/dlg

SVN Commit by andreas: r4638 - in trunk/pgadmin3: . src/dlg

From
svn@pgadmin.org
Date:
Author: andreas
Date: 2005-11-02 00:10:27 +0000 (Wed, 02 Nov 2005)
New Revision: 4638

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/dlg/dlgFunction.cpp
Log:
fix function return type array

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt    2005-11-02 00:00:15 UTC (rev 4637)
+++ trunk/pgadmin3/CHANGELOG.txt    2005-11-02 00:10:27 UTC (rev 4638)
@@ -17,6 +17,8 @@
 </ul>
 <br>
 <ul>
+    <li>2005-11-01 AP  1.4RC2 Fix function return type array (r: Andras Voros)
+    <li>2005-11-01 AP  1.4RC2 Fix query tool connect annoyance (r: Florian Pflug)
     <li>2005-10-31 DP  1.4RC1 Fix eventlog output in pgAgent, per Paolo Saudin
     <li>2005-10-31 DP  1.4RC1 Quote member names in compsoite types, per Ivan
     <li>2005-10-31 DP  1.4RC1 Enable the precision textbox when adding numeric members to composite types, per Ivan

Modified: trunk/pgadmin3/src/dlg/dlgFunction.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgFunction.cpp    2005-11-02 00:00:15 UTC (rev 4637)
+++ trunk/pgadmin3/src/dlg/dlgFunction.cpp    2005-11-02 00:10:27 UTC (rev 4638)
@@ -243,13 +243,13 @@
     }
     else
     {
-        wxString restrict;
+        wxString restrict;
         // create mode
-        restrict = wxT("(typtype IN ('b', 'c', 'd', 'p') AND typname NOT IN ('any', 'trigger', 'language_handler'))");
-        if (!settings->GetShowSystemObjects())
-            restrict += wxT(" AND nspname NOT LIKE 'pg_toast%' AND nspname NOT LIKE 'pg_temp%'");
+        restrict = wxT("(typtype IN ('b', 'c', 'd', 'p') AND typname NOT IN ('any', 'trigger', 'language_handler'))");
+        if (!settings->GetShowSystemObjects())
+            restrict += wxT(" AND nspname NOT LIKE 'pg_toast%' AND nspname NOT LIKE 'pg_temp%'");

-        DatatypeReader tr(database, restrict);
+        DatatypeReader tr(database, restrict);
         while (tr.HasMore())
         {
             pgDatatype dt=tr.GetDatatype();
@@ -644,7 +644,14 @@
             if (chkSetof->GetValue())
                 sql += wxT("SETOF ");

-            AppendQuoted(sql, cbReturntype->GetValue());
+            wxString rt=cbReturntype->GetValue();
+            if (rt.Right(2) == wxT("[]"))
+            {
+                AppendQuoted(sql, rt.Left(rt.Length()-2));
+                sql += wxT("[]");
+            }
+            else
+                AppendQuoted(sql, rt);
         }

         sql += wxT(" AS\n");