Skip to content

Commit

Permalink
[postgres] Do not overwrite detected type with requested type
Browse files Browse the repository at this point in the history
Fix #34629
  • Loading branch information
m-kuhn committed Mar 26, 2020
1 parent 9b0db6e commit 667e5d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -3643,7 +3643,7 @@ bool QgsPostgresProvider::getGeometryDetails()
}
}

QString detectedType = mRequestedGeomType == QgsWkbTypes::Unknown ? QString() : QgsPostgresConn::postgisWkbTypeName( mRequestedGeomType );
QString detectedType;
QString detectedSrid = mRequestedSrid;
if ( !schemaName.isEmpty() )
{
Expand All @@ -3660,7 +3660,7 @@ bool QgsPostgresProvider::getGeometryDetails()
if ( result.PQntuples() == 1 )
{
QString dt = result.PQgetvalue( 0, 0 );
if ( dt != "GEOMETRY" ) detectedType = dt;
detectedType = dt;

QString dim = result.PQgetvalue( 0, 2 );
if ( dim == QLatin1String( "3" ) && !detectedType.endsWith( 'M' ) )
Expand Down

0 comments on commit 667e5d9

Please sign in to comment.