Skip to content
Permalink
Browse files

postgres provider: show notices

  • Loading branch information
jef-n committed Feb 8, 2015
1 parent a264a27 commit b2cfe0b3306bf6dd2ca021320b8a8a45ffecaecb
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/providers/postgres/qgspostgresconn.cpp
@@ -164,6 +164,14 @@ QgsPostgresConn *QgsPostgresConn::connectDb( QString conninfo, bool readonly, bo
return conn;
}

static void noticeProcessor( void *arg, const char *message )
{
Q_UNUSED( arg );
QString msg( QString::fromUtf8( message ) );
msg.chop( 1 );
QgsMessageLog::logMessage( QObject::tr( "NOTICE: %1" ).arg( msg ), QObject::tr( "PostGIS" ) );
}

QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared, bool transaction )
: mRef( 1 )
, mOpenCursors( 0 )
@@ -268,6 +276,8 @@ QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared,
{
QgsDebugMsg( "Topology support available!" );
}

PQsetNoticeProcessor( mConn, noticeProcessor, 0 );
}

QgsPostgresConn::~QgsPostgresConn()

0 comments on commit b2cfe0b

Please sign in to comment.
You can’t perform that action at this time.