Skip to content

Commit d038ef8

Browse files
author
jef
committed
fix postgres error messages
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11992 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9bf890a commit d038ef8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
104104
if ( PQresultStatus( testAccess ) != PGRES_TUPLES_OK )
105105
{
106106
showMessageBox( tr( "Unable to access relation" ),
107-
tr( "Unable to access the %1 relation.\n" ).arg( mSchemaTableName )
108-
+ tr( "The error message from the database was:\n%1.\nSQL: %2" )
109-
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ).arg( sql ) ) );
107+
tr( "Unable to access the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" )
108+
.arg( mSchemaTableName )
109+
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) )
110+
.arg( sql ) );
110111
valid = false;
111112
disconnectDb();
112113
return;
@@ -123,9 +124,10 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
123124
if ( PQresultStatus( testAccess ) != PGRES_TUPLES_OK )
124125
{
125126
showMessageBox( tr( "Unable to access relation" ),
126-
tr( "Unable to determine table access privileges for the %1 relation.\n" ).arg( mSchemaTableName )
127-
+ tr( "The error message from the database was:\n%1.\nSQL: %2" )
128-
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) ).arg( sql ) );
127+
tr( "Unable to determine table access privileges for the %1 relation.\nThe error message from the database was:\n%2.\nSQL: %3" )
128+
.arg( mSchemaTableName )
129+
.arg( QString::fromUtf8( PQresultErrorMessage( testAccess ) ) )
130+
.arg( sql ) );
129131
valid = false;
130132
disconnectDb();
131133
return;

0 commit comments

Comments
 (0)