Skip to content

Commit

Permalink
fix postgres error messages
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11992 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 7, 2009
1 parent 3b3ca67 commit d5ef557
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -104,9 +104,10 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
if ( PQresultStatus( testAccess ) != PGRES_TUPLES_OK )
{
showMessageBox( tr( "Unable to access relation" ),
tr( "Unable to access the %1 relation.\n" ).arg( mSchemaTableName )
+ tr( "The error message from the database was:\n%1.\nSQL: %2" )
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ).arg( sql ) ) );
tr( "Unable to access the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" )
.arg( mSchemaTableName )
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) )
.arg( sql ) );
valid = false;
disconnectDb();
return;
Expand All @@ -123,9 +124,10 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
if ( PQresultStatus( testAccess ) != PGRES_TUPLES_OK )
{
showMessageBox( tr( "Unable to access relation" ),
tr( "Unable to determine table access privileges for the %1 relation.\n" ).arg( mSchemaTableName )
+ tr( "The error message from the database was:\n%1.\nSQL: %2" )
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) ).arg( sql ) );
tr( "Unable to determine table access privileges for the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" )
.arg( mSchemaTableName )
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) )
.arg( sql ) );
valid = false;
disconnectDb();
return;
Expand Down

0 comments on commit d5ef557

Please sign in to comment.