SVN Commit by dpage: r4904 - in trunk/pgadmin3: . src/dlg - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by dpage: r4904 - in trunk/pgadmin3: . src/dlg
Date
Msg-id 200601171244.k0HCiCBL025976@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: dpage
Date: 2006-01-17 12:44:12 +0000 (Tue, 17 Jan 2006)
New Revision: 4904

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/dlg/dlgFunction.cpp
Log:
Allow set returning functions to be created.

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt    2006-01-17 12:43:10 UTC (rev 4903)
+++ trunk/pgadmin3/CHANGELOG.txt    2006-01-17 12:44:12 UTC (rev 4904)
@@ -18,7 +18,8 @@
 </ul>
 <br>
 <ul>
-    <LI>2006-01-17 DP  1.4.2  Display the defintion of set returning procedures correctly.
+    <li>2006-01-17 DP         Allow set returning functions to be created.
+    <li>2006-01-17 DP  1.4.2  Display the defintion of set returning procedures correctly.
     <li>2006-01-17 DP  1.4.2  Fix drop procedure by including IN/OUT parameter flags in the name.
     <li>2006-01-13 DP  1.4.2  Fix role SQL - correctly define CREATEROLE/NOCREATEROLE per Andrus.
     <li>2006-01-11 DP         Allow result copy quoting configuration to be set explicitly rather than using the
resultexport settings [Magnus Hagander] 

Modified: trunk/pgadmin3/src/dlg/dlgFunction.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgFunction.cpp    2006-01-17 12:43:10 UTC (rev 4903)
+++ trunk/pgadmin3/src/dlg/dlgFunction.cpp    2006-01-17 12:44:12 UTC (rev 4904)
@@ -166,7 +166,6 @@
         }
         stReturntype->Hide();
         cbReturntype->Hide();
-        chkSetof->Hide();
     }
     else
     {
@@ -622,21 +621,38 @@
         {
             if (!connection->EdbMinimumVersion(8, 0))
             {
-                bool hasOut=false;
+                int outParams=0;
+                wxString setType;

                 int i;
                 for (i=0 ; i < lstArguments->GetItemCount() ; i++)
                 {
                     if (GetDirection(lstArguments->GetText(i)) > 0)
                     {
-                        hasOut=true;
-                        break;
+                        setType = lstArguments->GetText(i, typeColNo);
+                        outParams++;
                     }
                 }

-                if (!hasOut)
+                if (outParams == 0)
                     sql += wxT(" RETURNS void");
+                else
+                {
+                    if (chkSetof->GetValue())
+                    {
+                        if (outParams == 1)
+                        {
+                            sql += wxT(" RETURNS SETOF ") + setType;
+                        }
+                        else
+                        {
+                            sql += wxT(" RETURNS SETOF record");
+                        }
+                    }
+                }
+
             }
+
         }
         else
         {


pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r4903 - in trunk/pgadmin3: . src/schema
Next
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r4905 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/schema