[QGIS Commit] r8287 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 27 08:27:48 EDT 2008


Author: jef
Date: 2008-03-27 08:27:48 -0400 (Thu, 27 Mar 2008)
New Revision: 8287

Modified:
   trunk/qgis/src/app/qgsdbsourceselect.cpp
Log:
put out a warning message when accessible postgis cannot be determined

Modified: trunk/qgis/src/app/qgsdbsourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsdbsourceselect.cpp	2008-03-27 09:13:21 UTC (rev 8286)
+++ trunk/qgis/src/app/qgsdbsourceselect.cpp	2008-03-27 12:27:48 UTC (rev 8287)
@@ -536,13 +536,21 @@
   PGresult *result = PQexec(pg, sql.toUtf8());
   if (result)
   {
-    if( PQntuples(result)==0 )
+    if( PQresultStatus(result) != PGRES_TUPLES_OK) 
     {
+      QMessageBox::warning(this,
+                           tr("Accessible tables could not be determined"),
+                           QString ( tr("Database connection was successful, but the accessible tables could not be determined.\n\n"
+                                      "The error message from the database was:\n%1\n" ) )
+                              .arg( QString::fromUtf8(PQresultErrorMessage(result)) ) );
+    }
+    else if( PQntuples(result)==0 )
+    {
       QMessageBox::warning(this, tr("No accessible tables found"),
         tr
         ("Database connection was successful, but no accessible tables were found.\n\n"
-         "Please verify that you have SELECT privilege on a PostGIS' geometry_columns\n"
-         "table and at least one table carrying PostGIS geometry."));
+         "Please verify that you have SELECT privilege on a table carrying PostGIS\n"
+         "geometry."));
     }
     else 
     {



More information about the QGIS-commit mailing list