Fix the dlgFunction handling of preload libraries, per report from Michael Shapiro.
authorguillaume <guillaume@a7884b65-44f6-0310-8a51-81a127f17b15>
Mon, 20 Jul 2009 17:10:21 +0000 (17:10 +0000)
committerguillaume <guillaume@a7884b65-44f6-0310-8a51-81a127f17b15>
Mon, 20 Jul 2009 17:10:21 +0000 (17:10 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7976 a7884b65-44f6-0310-8a51-81a127f17b15

CHANGELOG
pgadmin/schema/pgDatabase.cpp

index c5b8527c20fbf8fcf9643a3350a2773255726997..3f2f7e51349264ac6edcbdf34b9e5dd9d5879d5e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,8 @@ Changes
 \r
 Date       Dev Ver     Change details\r
 ---------- --- ------  --------------\r
+2009-07-20 GL  1.10.1  Fix the dlgFunction handling of preload libraries, per\r
+                       report from Michael Shapiro.\r
 2009-07-20 GL  1.12.0  Multiple statements are an issue with pgPool-II in\r
                        its replication mode.\r
 2009-07-19 GL  1.10.1  Fix schedule and step dialogs [Ashesh Vashi, Guillaume\r
index 17273897b23600f321528e84da6d83e52252a95f..a53ad6cbd2c5e3b52185672be5695d5c36c2aaba 100644 (file)
@@ -621,6 +621,8 @@ pgObject *pgDatabaseFactory::CreateObjects(pgCollection *collection, ctlTree *br
 
 bool pgDatabase::CanDebugPlpgsql()
 {
+    wxString preload_option;
+
     // Result cache - 0 = not tested, 1 = false, 2 = true.
     if (canDebugPlpgsql == 1)
         return false;
@@ -631,8 +633,18 @@ bool pgDatabase::CanDebugPlpgsql()
     // the super users.
     if (GetServer()->GetSuperUser())
     {
+        // Parameter's name depends of the backend's version
+        if (server->GetConnection()->BackendMinimumVersion(8, 2))
+        {
+            preload_option = wxT("shared_preload_libraries");
+        }
+        else
+        {
+            preload_option = wxT("preload_libraries");
+        }
+
         // Check the appropriate plugin is loaded
-        if (!ExecuteScalar(wxT("SHOW shared_preload_libraries;")).Contains(wxT("plugin_debugger")))
+        if (!ExecuteScalar(wxT("SHOW ") + preload_option).Contains(wxT("plugin_debugger")))
         {
             canDebugPlpgsql = 1;
             return false;