Skip to content

Commit ff6a46e

Browse files
committedJan 10, 2012
postgres provider fixes
1 parent 9035cf7 commit ff6a46e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

100755100644
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,11 @@ bool QgsPostgresProvider::getFeature( QgsPostgresResult &queryResult, int row, b
453453
switch ( mPrimaryKeyType )
454454
{
455455
case pktOid:
456-
case pktInt:
457456
case pktTid:
457+
case pktInt:
458458
fid = mConnectionRO->getBinaryInt( queryResult, row, col++ );
459+
if ( mPrimaryKeyType == pktInt && fetchAttributes.contains( mPrimaryKeyAttrs[0] ) )
460+
feature.addAttribute( mPrimaryKeyAttrs[0], fid );
459461
break;
460462

461463
case pktFidMap:
@@ -2658,7 +2660,7 @@ bool QgsPostgresProvider::getGeometryDetails()
26582660

26592661
if ( srid.isEmpty() )
26602662
{
2661-
srid = layerProperty.srid;
2663+
srid = QString::number( layerProperty.srid );
26622664
}
26632665

26642666
if ( type.isEmpty() && !type.contains( "," ) )
@@ -2698,7 +2700,6 @@ bool QgsPostgresProvider::getGeometryDetails()
26982700
mEnabledCapabilities &= ~( QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures );
26992701
}
27002702

2701-
27022703
QgsDebugMsg( "Detected SRID is " + mDetectedSrid );
27032704
QgsDebugMsg( "Requested SRID is " + mRequestedSrid );
27042705
QgsDebugMsg( "Detected type is " + QString::number( mDetectedGeomType ) );

0 commit comments

Comments
 (0)
Please sign in to comment.