We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 321017f commit 4ba3290Copy full SHA for 4ba3290
src/providers/postgres/qgspostgresprovider.cpp
@@ -1724,7 +1724,13 @@ QVariant QgsPostgresProvider::defaultValue( int fieldId )
1724
1725
QgsPostgresResult res( connectionRO()->PQexec( QString( "SELECT %1" ).arg( defVal.toString() ) ) );
1726
1727
- return convertValue( fld.type(), res.PQgetvalue( 0, 0 ) );
+ if ( res.result() )
1728
+ return convertValue( fld.type(), res.PQgetvalue( 0, 0 ) );
1729
+ else
1730
+ {
1731
+ pushError( tr( "Could not execute query" ) );
1732
+ return QVariant();
1733
+ }
1734
}
1735
1736
return defVal;
0 commit comments