Skip to content

Commit

Permalink
postgres provider: disable editing of existing features when ctid is key
Browse files Browse the repository at this point in the history
(cherry picked from commit 2844005)
  • Loading branch information
jef-n committed Aug 26, 2015
1 parent 2890181 commit 86dcbf2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,9 @@ bool QgsPostgresProvider::determinePrimaryKey()
if ( res.PQntuples() == 1 )
{
mPrimaryKeyType = pktTid;

QgsMessageLog::logMessage( tr( "Primary key is ctid - changing of existing features disabled (%1; %2)" ).arg( mGeometryColumn ).arg( mQuery ) );
mEnabledCapabilities &= ~( QgsVectorDataProvider::DeleteFeatures | QgsVectorDataProvider::ChangeAttributeValues | QgsVectorDataProvider::ChangeGeometries );
}
else
{
Expand Down

0 comments on commit 86dcbf2

Please sign in to comment.