mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
postgres: consider subset string when deleting, updating and retrieving by fid
git-svn-id: http://svn.osgeo.org/qgis/trunk@11770 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
d726cb9893
commit
2642450bd2
@ -685,14 +685,26 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
|
||||
|
||||
QString QgsPostgresProvider::whereClause( int featureId ) const
|
||||
{
|
||||
QString whereClause;
|
||||
|
||||
if ( primaryKeyType != "tid" )
|
||||
{
|
||||
return QString( "%1=%2" ).arg( quotedIdentifier( primaryKey ) ).arg( featureId );
|
||||
whereClause = QString( "%1=%2" ).arg( quotedIdentifier( primaryKey ) ).arg( featureId );
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString( "%1='(%2,%3)'" ).arg( quotedIdentifier( primaryKey ) ).arg( featureId >> 16 ).arg( featureId & 0xffff );
|
||||
whereClause = QString( "%1='(%2,%3)'" ).arg( quotedIdentifier( primaryKey ) ).arg( featureId >> 16 ).arg( featureId & 0xffff );
|
||||
}
|
||||
|
||||
if ( !sqlWhereClause.isEmpty() )
|
||||
{
|
||||
if ( !whereClause.isEmpty() )
|
||||
whereClause += " and ";
|
||||
|
||||
whereClause += "(" + sqlWhereClause + ")";
|
||||
}
|
||||
|
||||
return whereClause;
|
||||
}
|
||||
|
||||
bool QgsPostgresProvider::featureAtId( int featureId, QgsFeature& feature, bool fetchGeometry, QgsAttributeList fetchAttributes )
|
||||
|
Loading…
x
Reference in New Issue
Block a user