Skip to content

Commit 2844005

Browse files
committed
postgres provider: disable editing of existing features when ctid is key
1 parent 9ed98a0 commit 2844005

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,9 @@ bool QgsPostgresProvider::determinePrimaryKey()
11031103
if ( res.PQntuples() == 1 )
11041104
{
11051105
mPrimaryKeyType = pktTid;
1106+
1107+
QgsMessageLog::logMessage( tr( "Primary key is ctid - changing of existing features disabled (%1; %2)" ).arg( mGeometryColumn ).arg( mQuery ) );
1108+
mEnabledCapabilities &= ~( QgsVectorDataProvider::DeleteFeatures | QgsVectorDataProvider::ChangeAttributeValues | QgsVectorDataProvider::ChangeGeometries );
11061109
}
11071110
else
11081111
{

0 commit comments

Comments
 (0)