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
  • Loading branch information
jef-n committed Mar 3, 2015
1 parent 9ed98a0 commit 2844005
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 2844005

Please sign in to comment.